[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sc/source svx/source sw/source

Oliver-Rainer Wittmann orw at apache.org
Fri May 10 04:02:41 PDT 2013


 sc/source/ui/view/editsh.cxx                     |   12 ++++++++++--
 svx/source/sidebar/text/TextUnderlineControl.cxx |   17 ++++-------------
 svx/source/sidebar/text/TextUnderlineControl.hxx |    4 +---
 sw/source/ui/shells/drwtxtex.cxx                 |   20 ++++++++++++++------
 4 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit 5a87a36054d28fdf3943c166f56bae2ec8f2619e
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Thu May 2 13:50:45 2013 +0000

    Resolves: #i122105# text property panel, underline style control
    
    correct application of chosen underline style in Calc cells and Drawing objects
    in Writer
    
    (cherry picked from commit fd23db16149eb517de9b2b403ff28ed0d31c83d6)
    
    Change-Id: Id77299c173eef99ea2eea0c0896e9bfd0bd9d1eb

diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index abec4c7..e8daf98 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -920,7 +920,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
             lcl_InvalidateUnder( rBindings );
             break;
 
-        case SID_ATTR_CHAR_UNDERLINE:   // Toggles
+        case SID_ATTR_CHAR_UNDERLINE:
         case SID_ULINE_VAL_SINGLE:
         case SID_ULINE_VAL_DOUBLE:
         case SID_ULINE_VAL_DOTTED:
@@ -931,7 +931,15 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
                 switch (nSlot)
                 {
                     case SID_ATTR_CHAR_UNDERLINE:
-                        eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
+                        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;
diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx
index de04d1e..2499f0a 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.cxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.cxx
@@ -78,7 +78,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);
@@ -118,10 +118,7 @@ void TextUnderlineControl::initial()
     maVSUnderline.Show();
 }
 
-void TextUnderlineControl::GetFocus()
-{
-    maVSUnderline.GrabFocus();
-}
+
 void TextUnderlineControl::Rearrange(FontUnderline eLine)
 {
     maVSUnderline.SetItemImage(1, maIMGSingle);
@@ -195,14 +192,8 @@ void TextUnderlineControl::Rearrange(FontUnderline eLine)
     }
     maVSUnderline.StartSelection();
 }
-ValueSet& TextUnderlineControl::GetValueSet()
-{
-    return maVSUnderline;
-}
-Control& TextUnderlineControl::GetPB()
-{
-    return maPBOptions;
-}
+
+
 IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
 {
     if(pControl == &maVSUnderline)
diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx
index a57ee00..1eeb834 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.hxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.hxx
@@ -39,10 +39,8 @@ public:
         Window* pParent,
         svx::sidebar::TextPropertyPanel& rPanel,
         SfxBindings* pBindings);
-    void GetFocus();
     void Rearrange(FontUnderline eLine);
-    ValueSet& GetValueSet();
-    Control& GetPB();
+
 private:
     svx::sidebar::TextPropertyPanel&     mrTextPropertyPanel;
     SfxBindings*        mpBindings;
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index c6f2010..7ad1409 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -106,13 +106,13 @@ using namespace ::com::sun::star;
 void SwDrawTextShell::Execute( SfxRequest &rReq )
 {
     SwWrtShell &rSh = GetShell();
-        OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
-        SfxItemSet aEditAttr(pOLV->GetAttribs());
+    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 sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
     const SfxItemSet *pNewAttrs = rReq.GetArgs();
 
     bool bRestoreSelection = false;
@@ -172,8 +172,16 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
 
         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));
+            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;
 


More information about the Libreoffice-commits mailing list