You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2013/05/02 15:50:51 UTC

svn commit: r1478371 - in /openoffice/trunk/main: sc/source/ui/view/editsh.cxx svx/source/sidebar/text/TextUnderlineControl.cxx svx/source/sidebar/text/TextUnderlineControl.hxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/sidebar/PagePropertyPanel.cxx

Author: orw
Date: Thu May  2 13:50:45 2013
New Revision: 1478371

URL: http://svn.apache.org/r1478371
Log:
122105: text property panel, underline style control: correct application of chosen underline style in Calc cells and Drawing objects in Writer

Modified:
    openoffice/trunk/main/sc/source/ui/view/editsh.cxx
    openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx
    openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx
    openoffice/trunk/main/sw/source/ui/shells/drwtxtex.cxx
    openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx

Modified: openoffice/trunk/main/sc/source/ui/view/editsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/view/editsh.cxx?rev=1478371&r1=1478370&r2=1478371&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/view/editsh.cxx (original)
+++ openoffice/trunk/main/sc/source/ui/view/editsh.cxx Thu May  2 13:50:45 2013
@@ -921,33 +921,41 @@ void ScEditShell::ExecuteAttr(SfxRequest
 			lcl_InvalidateUnder( rBindings );
 			break;
 
-		case SID_ATTR_CHAR_UNDERLINE:	// Toggles
-		case SID_ULINE_VAL_SINGLE:
-		case SID_ULINE_VAL_DOUBLE:
-		case SID_ULINE_VAL_DOTTED:
-			{
-				FontUnderline eOld = ((const SvxUnderlineItem&) pEditView->
-									GetAttribs().Get(EE_CHAR_UNDERLINE)).GetLineStyle();
-				FontUnderline eNew = eOld;
-				switch (nSlot)
-				{
-					case SID_ATTR_CHAR_UNDERLINE:
-						eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
-						break;
-					case SID_ULINE_VAL_SINGLE:
-						eNew = ( eOld == UNDERLINE_SINGLE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
-						break;
-					case SID_ULINE_VAL_DOUBLE:
-						eNew = ( eOld == UNDERLINE_DOUBLE ) ? UNDERLINE_NONE : UNDERLINE_DOUBLE;
-						break;
-					case SID_ULINE_VAL_DOTTED:
-						eNew = ( eOld == UNDERLINE_DOTTED ) ? UNDERLINE_NONE : UNDERLINE_DOTTED;
-						break;
-				}
-				aSet.Put( SvxUnderlineItem( eNew, EE_CHAR_UNDERLINE ) );
-				lcl_InvalidateUnder( rBindings );
-			}
-			break;
+        case SID_ATTR_CHAR_UNDERLINE:
+        case SID_ULINE_VAL_SINGLE:
+        case SID_ULINE_VAL_DOUBLE:
+        case SID_ULINE_VAL_DOTTED:
+            {
+                FontUnderline eOld = ((const SvxUnderlineItem&) pEditView->
+                                    GetAttribs().Get(EE_CHAR_UNDERLINE)).GetLineStyle();
+                FontUnderline eNew = eOld;
+                switch (nSlot)
+                {
+                    case SID_ATTR_CHAR_UNDERLINE:
+                        if ( pArgs )
+                        {
+                            const SvxTextLineItem& rTextLineItem = static_cast< const SvxTextLineItem& >( pArgs->Get( pArgs->GetPool()->GetWhich(nSlot) ) );
+                            eNew = rTextLineItem.GetLineStyle();
+                        }
+                        else
+                        {
+                            eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
+                        }
+                        break;
+                    case SID_ULINE_VAL_SINGLE:
+                        eNew = ( eOld == UNDERLINE_SINGLE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
+                        break;
+                    case SID_ULINE_VAL_DOUBLE:
+                        eNew = ( eOld == UNDERLINE_DOUBLE ) ? UNDERLINE_NONE : UNDERLINE_DOUBLE;
+                        break;
+                    case SID_ULINE_VAL_DOTTED:
+                        eNew = ( eOld == UNDERLINE_DOTTED ) ? UNDERLINE_NONE : UNDERLINE_DOTTED;
+                        break;
+                }
+                aSet.Put( SvxUnderlineItem( eNew, EE_CHAR_UNDERLINE ) );
+                lcl_InvalidateUnder( rBindings );
+            }
+            break;
 
 		case SID_ATTR_CHAR_OVERLINE:
 			{

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx?rev=1478371&r1=1478370&r2=1478371&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx Thu May  2 13:50:45 2013
@@ -95,7 +95,7 @@ void TextUnderlineControl::initial()
 	Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
 	maPBOptions.SetClickHdl(aLink);
 
-	maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK |  WB_NO_DIRECTSELECT  );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD |
+	maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
 
 	maVSUnderline.InsertItem(1, maIMGSingle ,String(SVX_RES(STR_SINGLE)));
 	maVSUnderline.SetItemData(1, (void*)(sal_uInt64)UNDERLINE_SINGLE);
@@ -135,10 +135,7 @@ void TextUnderlineControl::initial()
 	maVSUnderline.Show();
 }
 
-void TextUnderlineControl::GetFocus()
-{
-	maVSUnderline.GrabFocus();
-}
+
 void TextUnderlineControl::Rearrange(FontUnderline eLine)
 {
 	// high contrast
@@ -213,14 +210,8 @@ void TextUnderlineControl::Rearrange(Fon
 	}
 	maVSUnderline.StartSelection();
 }
-ValueSet& TextUnderlineControl::GetValueSet()
-{
-	return maVSUnderline;
-}
-Control& TextUnderlineControl::GetPB()
-{
-	return maPBOptions;
-}
+
+
 IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
 {
 	if(pControl == &maVSUnderline)  

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx?rev=1478371&r1=1478370&r2=1478371&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.hxx Thu May  2 13:50:45 2013
@@ -38,15 +38,13 @@ namespace svx{ namespace sidebar {
 class TextUnderlineControl:public svx::sidebar::PopupControl
 {
 public:
-	TextUnderlineControl (
+    TextUnderlineControl (
         Window* pParent,
         svx::sidebar::TextPropertyPanel& rPanel,
         SfxBindings* pBindings);
-	void GetFocus();
-	void Rearrange(FontUnderline eLine);
-	ValueSet& GetValueSet();
-	Control& GetPB();
-private:	
+    void Rearrange(FontUnderline eLine);
+
+private:
 	svx::sidebar::TextPropertyPanel&     mrTextPropertyPanel;
 	SfxBindings*		mpBindings;
 	ValueSet			maVSUnderline;

Modified: openoffice/trunk/main/sw/source/ui/shells/drwtxtex.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/ui/shells/drwtxtex.cxx?rev=1478371&r1=1478370&r2=1478371&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/ui/shells/drwtxtex.cxx (original)
+++ openoffice/trunk/main/sw/source/ui/shells/drwtxtex.cxx Thu May  2 13:50:45 2013
@@ -140,35 +140,35 @@ using namespace ::com::sun::star;
 
 void SwDrawTextShell::Execute( SfxRequest &rReq )
 {
-	SwWrtShell &rSh = GetShell();
-    	OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
-    	SfxItemSet aEditAttr(pOLV->GetAttribs());
-	SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
+    SwWrtShell &rSh = GetShell();
+    OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
+    SfxItemSet aEditAttr(pOLV->GetAttribs());
+    SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
 
-	sal_uInt16 nSlot = rReq.GetSlot();
+    const sal_uInt16 nSlot = rReq.GetSlot();
 
-	sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
-	const SfxItemSet *pNewAttrs = rReq.GetArgs();
+    const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
+    const SfxItemSet *pNewAttrs = rReq.GetArgs();
 
-	bool bRestoreSelection = false;
-	ESelection aOldSelection;
+    bool bRestoreSelection = false;
+    ESelection aOldSelection;
 
-	sal_uInt16 nEEWhich = 0;
-	switch (nSlot)
-	{
-		case SID_LANGUAGE_STATUS:
+    sal_uInt16 nEEWhich = 0;
+    switch (nSlot)
+    {
+        case SID_LANGUAGE_STATUS:
         {
-			aOldSelection = pOLV->GetSelection();
-			if (!pOLV->GetEditView().HasSelection())
-			{
-				bRestoreSelection	= true;
-				pOLV->GetEditView().SelectCurrentWord();
-			}
+            aOldSelection = pOLV->GetSelection();
+            if (!pOLV->GetEditView().HasSelection())
+            {
+                bRestoreSelection	= true;
+                pOLV->GetEditView().SelectCurrentWord();
+            }
 
-			bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,GetView(),rSh);
-			break;
+            bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,GetView(),rSh);
+            break;
         }
-        
+
         case SID_THES:
         {
             String aReplaceText;
@@ -178,8 +178,8 @@ void SwDrawTextShell::Execute( SfxReques
             if (aReplaceText.Len() > 0)
                 ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
             break;
-        }        
-        
+        }
+
         case SID_ATTR_CHAR_FONT:
         case SID_ATTR_CHAR_FONTHEIGHT:
         case SID_ATTR_CHAR_WEIGHT:
@@ -202,12 +202,20 @@ void SwDrawTextShell::Execute( SfxReques
 
         case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
 
-		case SID_ATTR_CHAR_UNDERLINE:
-		{
-		 	FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
-			aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
-		}
-		break;
+        case SID_ATTR_CHAR_UNDERLINE:
+        {
+            if ( pNewAttrs )
+            {
+                const SvxTextLineItem& rTextLineItem = static_cast< const SvxTextLineItem& >( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich(nSlot) ) );
+                aNewAttr.Put( SvxUnderlineItem( rTextLineItem.GetLineStyle(), EE_CHAR_UNDERLINE ) );
+            }
+            else
+            {
+                FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
+                aNewAttr.Put( SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE) );
+            }
+        }
+        break;
 
 		case SID_ATTR_CHAR_OVERLINE:
 		{

Modified: openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx?rev=1478371&r1=1478370&r2=1478371&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx (original)
+++ openoffice/trunk/main/sw/source/ui/sidebar/PagePropertyPanel.cxx Thu May  2 13:50:45 2013
@@ -68,7 +68,7 @@ namespace {
             const cssu::Reference< css::frame::XModel >& xModel = xController->getModel();
             if ( xModel.is() )
             {
-                const cssu::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, cssu::UNO_QUERY_THROW );
+                const cssu::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, cssu::UNO_QUERY_THROW );
                 if ( xSuppUndo.is() )
                 {
                     const cssu::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), cssu::UNO_QUERY_THROW );