[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 11 commits - include/sfx2 include/svx include/vcl offapi/com sfx2/source solenv/bin svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/AllLangResTarget_sw.mk sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk vcl/source

abdulmajeed ahmed aalabdulrazzaq at kacst.edu.sa
Wed Jun 5 02:07:17 PDT 2013


 include/sfx2/sidebar/SidebarPanelBase.hxx     |    2 
 include/sfx2/sidebar/SidebarToolBox.hxx       |    6 
 include/svx/sidebar/PanelLayout.hxx           |   34 +
 include/vcl/builder.hxx                       |    9 
 include/vcl/toolbox.hxx                       |   12 
 offapi/com/sun/star/ui/XSidebarPanel.idl      |    4 
 sfx2/source/sidebar/Deck.cxx                  |    4 
 sfx2/source/sidebar/Deck.hxx                  |    3 
 sfx2/source/sidebar/DeckLayouter.cxx          |   13 
 sfx2/source/sidebar/DeckLayouter.hxx          |    3 
 sfx2/source/sidebar/SidebarController.cxx     |   14 
 sfx2/source/sidebar/SidebarController.hxx     |    2 
 sfx2/source/sidebar/SidebarPanelBase.cxx      |   21 +
 sfx2/source/sidebar/SidebarToolBox.cxx        |   16 
 solenv/bin/linkoo                             |    2 
 svx/Library_svx.mk                            |    1 
 svx/UIConfig_svx.mk                           |    1 
 svx/source/sidebar/PanelLayout.cxx            |   39 ++
 svx/source/sidebar/text/SvxSBFontNameBox.cxx  |   16 
 svx/source/sidebar/text/SvxSBFontNameBox.hxx  |    3 
 svx/source/sidebar/text/TextPropertyPanel.cxx |  482 +++++++++++---------------
 svx/source/sidebar/text/TextPropertyPanel.hrc |   26 -
 svx/source/sidebar/text/TextPropertyPanel.hxx |   34 -
 svx/source/sidebar/text/TextPropertyPanel.src |  249 -------------
 svx/uiconfig/ui/sidebartextpanel.ui           |  341 ++++++++++++++++++
 sw/AllLangResTarget_sw.mk                     |    2 
 sw/UIConfig_swriter.mk                        |    1 
 sw/inc/helpid.h                               |    1 
 sw/source/ui/config/optdlg.hrc                |    9 
 sw/source/ui/config/optdlg.src                |   75 ----
 sw/source/ui/config/optpage.cxx               |  110 ++---
 sw/source/ui/inc/optpage.hxx                  |   16 
 sw/uiconfig/swriter/ui/optcomparison.ui       |  202 ++++++++++
 vcl/source/window/builder.cxx                 |   39 ++
 vcl/source/window/toolbox.cxx                 |    5 
 vcl/source/window/toolbox2.cxx                |  136 +++++++
 36 files changed, 1200 insertions(+), 733 deletions(-)

New commits:
commit cedb8f7995f0085bf1b851553f88b87118dfccda
Author: abdulmajeed ahmed <aalabdulrazzaq at kacst.edu.sa>
Date:   Thu May 30 17:27:46 2013 +0200

    Resolves: fdo#64151 Convert Comparison tab page to .ui
    
    (cherry picked from commit c99830c221cd2362d58caac15dd2fb33a2b1ad38)
    
    Change-Id: Ia1cd8c868de4c73ae518b2775dc568d32a15f16f
    
    fix spellings in opt comparision .ui conversion
    
    Change-Id: If5d85eede864adf150c417adeb08fc32e5eb7acf
    (cherry picked from commit 4f34a463dcf781ff23619b4513f6f88aa7d8e75e)

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 4aa005c..a1cd2c7 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -73,7 +73,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/chrdlg/paradlg.src \
     sw/source/ui/config/mailconfigpage.src \
     sw/source/ui/config/optcomp.src \
-    sw/source/ui/config/optdlg.src \
+	sw/source/ui/config/optdlg.src \
     sw/source/ui/config/optload.src \
     sw/source/ui/config/redlopt.src \
     sw/source/ui/dbui/addresslistdialog.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index eb100cf..a01d738 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/newuserindexdialog \
 	sw/uiconfig/swriter/ui/numparapage \
 	sw/uiconfig/swriter/ui/numberingnamedialog \
+	sw/uiconfig/swriter/ui/optcomparison \
 	sw/uiconfig/swriter/ui/opttestpage \
 	sw/uiconfig/swriter/ui/outlinenumbering \
 	sw/uiconfig/swriter/ui/outlinenumberingpage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 2fa479f..e2c2be3 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -193,7 +193,6 @@
 
 #define HID_OPTCOMPATIBILITY_PAGE                               "SW_HID_OPTCOMPATIBILITY_PAGE"
 #define HID_COMPATIBILITY_OPTIONS_BOX                           "SW_HID_COMPATIBILITY_OPTIONS_BOX"
-#define HID_COMPARISON_OPT				                        "SW_HID_COMPARISON_OPT"
 
 #define HID_PROPERTYPANEL_WRAP_SECTION          "SW_HID_PROPERTYPANEL_WRAP_SECTION"
 #define HID_PROPERTYPANEL_WRAP_RB_NO_WRAP       "SW_HID_PROPERTYPANEL_WRAP_RB_NO_WRAP"
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index 4d716c8..160b8f1 100644
--- a/sw/source/ui/config/optdlg.hrc
+++ b/sw/source/ui/config/optdlg.hrc
@@ -135,13 +135,4 @@
 #define CB_MATH_BASELINE_ALIGNMENT    16
 
 
-#define FL_CMP						141
-#define RB_AUTO						142
-#define RB_WORD						143
-#define RB_CHAR						144
-#define FL_SET						145
-#define CB_RSID						146
-#define CB_IGNORE					147
-#define NF_LEN						148
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 889408f9..b411db0 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -641,79 +641,4 @@ StringArray STR_PRINTOPTUI
     };
 };
 
-
-/**************************************************************************/
-/*                                                                        */
-/* 	TabPage Comparison                                           		  */
-/*                                                                        */
-/**************************************************************************/
-TabPage TP_COMPARISON_OPT
-{
-    HelpID = HID_COMPARISON_OPT;
-    SVLook = TRUE ;
-    Hide = TRUE;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT );
-    FixedLine FL_CMP
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text [ en-US ] = "Compare documents";
-    };
-    RadioButton RB_AUTO
-    {
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "~Auto";
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    RadioButton RB_WORD
-    {
-        Pos = MAP_APPFONT ( 12 , 27 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "By ~word";
-    };
-    RadioButton RB_CHAR
-    {
-        Pos = MAP_APPFONT ( 12 , 40 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "By ~character";
-    };
-    FixedLine FL_SET
-    {
-        Pos = MAP_APPFONT ( 6 , 56 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text [ en-US ] = "Settings";
-    };
-    CheckBox CB_RSID
-    {
-        Pos = MAP_APPFONT ( 12 , 69 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "Use ~RSID";
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    CheckBox CB_IGNORE
-    {
-        Pos = MAP_APPFONT ( 12 , 82 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "Ignore ~pieces of length";
-    };
-    NumericField NF_LEN
-    {
-        Pos = MAP_APPFONT ( 100 , 80 ) ;
-        Size = MAP_APPFONT ( 25 , 12 ) ;
-        Border = TRUE ;
-        Left = TRUE ;
-        First = 1 ;
-        Minimum = 1 ;
-        Maximum = 99;
-        Repeat = TRUE ;
-        Spin = TRUE ;
-        SpinSize = 1 ;
-        StrictFormat = TRUE ;
-        TabStop = TRUE ;
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6afe7d3..79595b2 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2262,24 +2262,22 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
 
 //----------------------------------------------------------
 SwCompareOptionsTabPage::SwCompareOptionsTabPage(  Window* pParent, const SfxItemSet& rSet )
-    : SfxTabPage( pParent, SW_RES( TP_COMPARISON_OPT ), rSet ),
-
-    aComparisonFL(	this, SW_RES( FL_CMP ) ),
-    aAutoRB(		this, SW_RES( RB_AUTO ) ),
-    aWordRB(		this, SW_RES( RB_WORD ) ),
-    aCharRB(		this, SW_RES( RB_CHAR ) ),
-    aSettingsFL(	this, SW_RES( FL_SET ) ),
-    aRsidCB(		this, SW_RES( CB_RSID) ),
-    aIgnoreCB(		this, SW_RES( CB_IGNORE ) ),
-    aLenNF(			this, SW_RES( NF_LEN ) )
+    : SfxTabPage( pParent,"OptComparison","modules/swriter/ui/optcomparison.ui", rSet )
 {
-    FreeResource();
+    get(m_pAutoRB,"auto");
+    get(m_pWordRB, "byword");
+    get(m_pCharRB, "bycharacter");
+
+    get(m_pRsidCB, "useRSID");
+    get(m_pIgnoreCB, "ignore");
+    get(m_pLenNF, "ignorelen");
+
     Link aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) );
-    aAutoRB.SetClickHdl( aLnk );
-    aWordRB.SetClickHdl( aLnk );
-    aCharRB.SetClickHdl( aLnk );
+    m_pAutoRB->SetClickHdl( aLnk );
+    m_pWordRB->SetClickHdl( aLnk );
+    m_pCharRB->SetClickHdl( aLnk );
 
-    aIgnoreCB.SetClickHdl( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) );
+    m_pIgnoreCB->SetClickHdl( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) );
 }
 
 SwCompareOptionsTabPage::~SwCompareOptionsTabPage()
@@ -2296,35 +2294,35 @@ sal_Bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet& )
     sal_Bool bRet = sal_False;
     SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
 
-    if( aAutoRB.IsChecked() != aAutoRB.GetSavedValue() ||
-        aWordRB.IsChecked() != aWordRB.GetSavedValue() ||
-        aCharRB.IsChecked() != aCharRB.GetSavedValue() )
+    if( m_pAutoRB->IsChecked() != m_pAutoRB->GetSavedValue() ||
+        m_pWordRB->IsChecked() != m_pWordRB->GetSavedValue() ||
+        m_pCharRB->IsChecked() != m_pCharRB->GetSavedValue() )
     {
         SvxCompareMode eCmpMode = SVX_CMP_AUTO;
 
-        if ( aAutoRB.IsChecked() ) eCmpMode = SVX_CMP_AUTO;
-        if ( aWordRB.IsChecked() ) eCmpMode = SVX_CMP_BY_WORD;
-        if ( aCharRB.IsChecked() ) eCmpMode = SVX_CMP_BY_CHAR;
+        if ( m_pAutoRB->IsChecked() ) eCmpMode = SVX_CMP_AUTO;
+        if ( m_pWordRB->IsChecked() ) eCmpMode = SVX_CMP_BY_WORD;
+        if ( m_pCharRB->IsChecked() ) eCmpMode = SVX_CMP_BY_CHAR;
 
         pOpt->SetCompareMode( eCmpMode );
         bRet = sal_True;
     }
 
-    if( aRsidCB.IsChecked() != aRsidCB.GetSavedValue() )
+    if( m_pRsidCB->IsChecked() != m_pRsidCB->GetSavedValue() )
     {
-        pOpt->SetUseRsid( aRsidCB.IsChecked() );
+        pOpt->SetUseRsid( m_pRsidCB->IsChecked() );
         bRet = sal_True;
     }
 
-    if( aIgnoreCB.IsChecked() != aIgnoreCB.GetSavedValue() )
+    if( m_pIgnoreCB->IsChecked() != m_pIgnoreCB->GetSavedValue() )
     {
-        pOpt->SetIgnorePieces( aIgnoreCB.IsChecked() );
+        pOpt->SetIgnorePieces( m_pIgnoreCB->IsChecked() );
         bRet = sal_True;
     }
 
-    if( aLenNF.IsModified() )
+    if( m_pLenNF->IsModified() )
     {
-        pOpt->SetPieceLen( aLenNF.GetValue() );
+        pOpt->SetPieceLen( m_pLenNF->GetValue() );
         bRet = sal_True;
     }
 
@@ -2338,58 +2336,54 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet& )
     SvxCompareMode eCmpMode = pOpt->GetCompareMode();
     if( eCmpMode == SVX_CMP_AUTO )
     {
-        aAutoRB.Check();
-        aSettingsFL.Disable();
-        aRsidCB.Disable();
-        aIgnoreCB.Disable();
-        aLenNF.Disable();
+        m_pAutoRB->Check();
+        m_pRsidCB->Disable();
+        m_pIgnoreCB->Disable();
+        m_pLenNF->Disable();
     }
     else if( eCmpMode == SVX_CMP_BY_WORD )
     {
-        aWordRB.Check();
-        aSettingsFL.Enable();
-        aRsidCB.Enable();
-        aIgnoreCB.Enable();
-        aLenNF.Enable();
+        m_pWordRB->Check();
+        m_pRsidCB->Enable();
+        m_pIgnoreCB->Enable();
+        m_pLenNF->Enable();
     }
     else if( eCmpMode == SVX_CMP_BY_CHAR)
     {
-        aCharRB.Check();
-        aSettingsFL.Enable();
-        aRsidCB.Enable();
-        aIgnoreCB.Enable();
-        aLenNF.Enable();
+        m_pCharRB->Check();
+        m_pRsidCB->Enable();
+        m_pIgnoreCB->Enable();
+        m_pLenNF->Enable();
     }
-    aAutoRB.SaveValue();
-    aWordRB.SaveValue();
-    aCharRB.SaveValue();
+    m_pAutoRB->SaveValue();
+    m_pWordRB->SaveValue();
+    m_pCharRB->SaveValue();
 
-    aRsidCB.Check( pOpt->IsUseRsid() );
-    aRsidCB.SaveValue();
+    m_pRsidCB->Check( pOpt->IsUseRsid() );
+    m_pRsidCB->SaveValue();
 
-    aIgnoreCB.Check( pOpt->IsIgnorePieces() );
-    aIgnoreCB.SaveValue();
+    m_pIgnoreCB->Check( pOpt->IsIgnorePieces() );
+    m_pIgnoreCB->SaveValue();
 
-    aLenNF.Enable( aIgnoreCB.IsChecked() && eCmpMode );
+    m_pLenNF->Enable( m_pIgnoreCB->IsChecked() && eCmpMode );
 
-    aLenNF.SetValue( pOpt->GetPieceLen() );
-    aLenNF.SaveValue();
+    m_pLenNF->SetValue( pOpt->GetPieceLen() );
+    m_pLenNF->SaveValue();
 }
 
 IMPL_LINK_NOARG(SwCompareOptionsTabPage, ComparisonHdl)
 {
-    bool bChecked = !aAutoRB.IsChecked();
-    aSettingsFL.Enable( bChecked );
-    aRsidCB.Enable( bChecked );
-    aIgnoreCB.Enable( bChecked );
-    aLenNF.Enable( bChecked && aIgnoreCB.IsChecked() );
+    bool bChecked = !m_pAutoRB->IsChecked();
+    m_pRsidCB->Enable( bChecked );
+    m_pIgnoreCB->Enable( bChecked );
+    m_pLenNF->Enable( bChecked && m_pIgnoreCB->IsChecked() );
 
     return 0;
 }
 
 IMPL_LINK_NOARG(SwCompareOptionsTabPage, IgnoreHdl)
 {
-    aLenNF.Enable( aIgnoreCB.IsChecked() );
+    m_pLenNF->Enable( m_pIgnoreCB->IsChecked() );
     return 0;
 }
 
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index e61c847..bf4166a 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -462,15 +462,13 @@ private:
 
 class SwCompareOptionsTabPage : public SfxTabPage
 {
-    FixedLine aComparisonFL;
-    RadioButton aAutoRB;
-    RadioButton aWordRB;
-    RadioButton aCharRB;
-
-    FixedLine aSettingsFL;
-    CheckBox aRsidCB;
-    CheckBox aIgnoreCB;
-    NumericField aLenNF;
+    RadioButton*  m_pAutoRB;
+    RadioButton*  m_pWordRB;
+    RadioButton*  m_pCharRB;
+
+    CheckBox*     m_pRsidCB;
+    CheckBox*     m_pIgnoreCB;
+    NumericField* m_pLenNF;
 
     SwCompareOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
     ~SwCompareOptionsTabPage();
diff --git a/sw/uiconfig/swriter/ui/optcomparison.ui b/sw/uiconfig/swriter/ui/optcomparison.ui
new file mode 100644
index 0000000..a49b1f8
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/optcomparison.ui
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">1</property>
+    <property name="upper">99</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkBox" id="OptComparison">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">5</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkRadioButton" id="auto">
+                    <property name="label" translatable="yes">A_uto</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="active">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">byword</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkRadioButton" id="byword">
+                    <property name="label" translatable="yes">By w_ord</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">bycharacter</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkRadioButton" id="bycharacter">
+                    <property name="label" translatable="yes">By _character</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Compare documents</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">12</property>
+                <child>
+                  <object class="GtkCheckButton" id="ignore">
+                    <property name="label" translatable="yes">Ignore _pieces of length</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="useRSID">
+                    <property name="label" translatable="yes">Use _RSID</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="image_position">right</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="ignorelen">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">•</property>
+                    <property name="invisible_char_set">True</property>
+                    <property name="adjustment">adjustment1</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="setting">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Settings</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>
commit de6b5495885208d30aebdf6b65b7021d5d5618ea
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 2 06:57:28 2013 +0200

    fix Werror tinderbox problem
    
    (cherry picked from commit 727e63452dc4de88d5dc62d5b1da6da0647564ba)
    
    Change-Id: I89de0f8cf7279fb12c94abdb8ea6228f13eadc6a

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 52969b2..82713a7 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -55,8 +55,8 @@ Deck::Deck (
       maIcon(),
       msIconURL(rDeckDescriptor.msIconURL),
       msHighContrastIconURL(rDeckDescriptor.msHighContrastIconURL),
-      maPanels(),
       mnMinimalWidth(0),
+      maPanels(),
       mpTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, this, rCloserAction)),
       mpScrollClipWindow(new Window(this)),
       mpScrollContainer(new ScrollContainerWindow(mpScrollClipWindow.get())),
commit 82584e86a231b0e1547878efdd808de110e8a6ab
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Sun Jun 2 04:46:58 2013 +0200

    sidebar: Restrict the minimal width of the sidebar.
    
    Change-Id: I99051830c4393b420125332e787c3abdc5a6aa61
    (cherry picked from commit e66be44b69ee2a1b99bda32af93ea453c669b319)

diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx
index 330533a..a7e8db1 100644
--- a/include/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/include/sfx2/sidebar/SidebarPanelBase.hxx
@@ -97,6 +97,8 @@ public:
     // XSidebarPanel
     virtual css::ui::LayoutSize SAL_CALL getHeightForWidth (sal_Int32 nWidth)
         throw(cssu::RuntimeException);
+    virtual sal_Int32 SAL_CALL getMinimalWidth ()
+        throw(cssu::RuntimeException);
 
 protected:
     cssu::Reference<css::frame::XFrame> mxFrame;
diff --git a/offapi/com/sun/star/ui/XSidebarPanel.idl b/offapi/com/sun/star/ui/XSidebarPanel.idl
index 64932de..de02681 100644
--- a/offapi/com/sun/star/ui/XSidebarPanel.idl
+++ b/offapi/com/sun/star/ui/XSidebarPanel.idl
@@ -51,6 +51,10 @@ interface XSidebarPanel
         The height is set via the XWindow interface.
     */
     LayoutSize getHeightForWidth ( [in] long nWidth);
+
+    /** Minimal possible width of this panel.
+    */
+    long getMinimalWidth();
 } ;
 
 } ; } ; } ; } ;
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 9a16ad5..52969b2 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -56,6 +56,7 @@ Deck::Deck (
       msIconURL(rDeckDescriptor.msIconURL),
       msHighContrastIconURL(rDeckDescriptor.msHighContrastIconURL),
       maPanels(),
+      mnMinimalWidth(0),
       mpTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, this, rCloserAction)),
       mpScrollClipWindow(new Window(this)),
       mpScrollContainer(new ScrollContainerWindow(mpScrollClipWindow.get())),
@@ -294,8 +295,11 @@ const SharedPanelContainer& Deck::GetPanels (void) const
 
 void Deck::RequestLayout (void)
 {
+    mnMinimalWidth = 0;
+
     DeckLayouter::LayoutDeck(
         GetContentArea(),
+        mnMinimalWidth,
         maPanels,
         *GetTitleBar(),
         *mpScrollClipWindow,
diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx
index f49d38f..0dc86ff 100644
--- a/sfx2/source/sidebar/Deck.hxx
+++ b/sfx2/source/sidebar/Deck.hxx
@@ -75,6 +75,8 @@ public:
     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
 
+    sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
+
     class ScrollContainerWindow : public Window
     {
     public:
@@ -92,6 +94,7 @@ private:
     Image maIcon;
     const ::rtl::OUString msIconURL;
     const ::rtl::OUString msHighContrastIconURL;
+    sal_Int32 mnMinimalWidth;
     SharedPanelContainer maPanels;
     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
     ::boost::scoped_ptr<Window> mpScrollClipWindow;
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx
index ade08bb..0d1ff57 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -47,6 +47,7 @@ namespace {
 
 void DeckLayouter::LayoutDeck (
     const Rectangle aContentArea,
+    sal_Int32& rMinimalWidth,
     SharedPanelContainer& rPanels,
     Window& rDeckTitleBar,
     Window& rScrollClipWindow,
@@ -70,6 +71,7 @@ void DeckLayouter::LayoutDeck (
         }
         aBox = LayoutPanels(
             aBox,
+            rMinimalWidth,
             aLayoutItems,
             rScrollClipWindow,
             rScrollContainer,
@@ -84,6 +86,7 @@ void DeckLayouter::LayoutDeck (
 
 Rectangle DeckLayouter::LayoutPanels (
     const Rectangle aContentArea,
+    sal_Int32& rMinimalWidth,
     ::std::vector<LayoutItem>& rLayoutItems,
     Window& rScrollClipWindow,
     Window& rScrollContainer,
@@ -98,7 +101,7 @@ Rectangle DeckLayouter::LayoutPanels (
     // height that is left when all panel titles and separators are
     // taken into account.
     sal_Int32 nAvailableHeight (aBox.GetHeight());
-    GetRequestedSizes(rLayoutItems, nAvailableHeight, aBox);
+    GetRequestedSizes(rLayoutItems, nAvailableHeight, rMinimalWidth, aBox);
     const sal_Int32 nTotalDecorationHeight (aBox.GetHeight() - nAvailableHeight);
 
     // Analyze the requested heights.
@@ -120,6 +123,7 @@ Rectangle DeckLayouter::LayoutPanels (
         // Show a vertical scrollbar.
         return LayoutPanels(
             aContentArea,
+            rMinimalWidth,
             rLayoutItems,
             rScrollClipWindow,
             rScrollContainer,
@@ -284,6 +288,7 @@ sal_Int32 DeckLayouter::PlacePanels (
 void DeckLayouter::GetRequestedSizes (
     ::std::vector<LayoutItem>& rLayoutItems,
     sal_Int32& rAvailableHeight,
+    sal_Int32& rMinimalWidth,
     const Rectangle& rContentBox)
 {
     rAvailableHeight = rContentBox.GetHeight();
@@ -316,7 +321,13 @@ void DeckLayouter::GetRequestedSizes (
             {
                 Reference<ui::XSidebarPanel> xPanel (iItem->mpPanel->GetPanelComponent());
                 if (xPanel.is())
+                {
                     aLayoutSize = xPanel->getHeightForWidth(rContentBox.GetWidth());
+
+                    sal_Int32 nWidth = xPanel->getMinimalWidth();
+                    if (nWidth > rMinimalWidth)
+                        rMinimalWidth = nWidth;
+                }
                 else
                     aLayoutSize = ui::LayoutSize(MinimalPanelHeight, -1, 0);
             }
diff --git a/sfx2/source/sidebar/DeckLayouter.hxx b/sfx2/source/sidebar/DeckLayouter.hxx
index e1df7f2..a284c08 100644
--- a/sfx2/source/sidebar/DeckLayouter.hxx
+++ b/sfx2/source/sidebar/DeckLayouter.hxx
@@ -44,6 +44,7 @@ class DeckLayouter
 public:
     static void LayoutDeck (
         const Rectangle aContentArea,
+        sal_Int32& rMinimalWidth,
         SharedPanelContainer& rPanels,
         Window& pDeckTitleBar,
         Window& pScrollClipWindow,
@@ -78,6 +79,7 @@ private:
     };
     static Rectangle LayoutPanels (
         const Rectangle aContentArea,
+        sal_Int32& rMinimalWidth,
         ::std::vector<LayoutItem>& rLayoutItems,
         Window& rScrollClipWindow,
         Window& rScrollContainer,
@@ -86,6 +88,7 @@ private:
     static void GetRequestedSizes (
         ::std::vector<LayoutItem>& rLayoutItem,
         sal_Int32& rAvailableHeight,
+        sal_Int32& rMinimalWidth,
         const Rectangle& rContentBox);
     static void DistributeHeights (
         ::std::vector<LayoutItem>& rLayoutItems,
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 7c883da..e49465e 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -272,9 +272,13 @@ void SAL_CALL SidebarController::statusChanged (const css::frame::FeatureStateEv
 void SAL_CALL SidebarController::requestLayout (void)
     throw(cssu::RuntimeException)
 {
+    sal_Int32 nMinimalWidth = 0;
     if (mpCurrentDeck)
+    {
         mpCurrentDeck->RequestLayout();
-    RestrictWidth();
+        nMinimalWidth = mpCurrentDeck->GetMinimalWidth();
+    }
+    RestrictWidth(nMinimalWidth);
 }
 
 
@@ -340,14 +344,16 @@ void SidebarController::NotifyResize (void)
     mpTabBar->Show();
 
     // Determine if the closer of the deck can be shown.
+    sal_Int32 nMinimalWidth = 0;
     if (mpCurrentDeck)
     {
         DeckTitleBar* pTitleBar = mpCurrentDeck->GetTitleBar();
         if (pTitleBar != NULL && pTitleBar->IsVisible())
             pTitleBar->SetCloserVisible(CanModifyChildWindowWidth());
+        nMinimalWidth = mpCurrentDeck->GetMinimalWidth();
     }
 
-    RestrictWidth();
+    RestrictWidth(nMinimalWidth);
 }
 
 
@@ -1050,7 +1056,7 @@ sal_Int32 SidebarController::SetChildWindowWidth (const sal_Int32 nNewWidth)
 
 
 
-void SidebarController::RestrictWidth (void)
+void SidebarController::RestrictWidth (sal_Int32 nWidth)
 {
     SfxSplitWindow* pSplitWindow = GetSplitWindow();
     if (pSplitWindow != NULL)
@@ -1059,7 +1065,7 @@ void SidebarController::RestrictWidth (void)
         const sal_uInt16 nSetId (pSplitWindow->GetSet(nId));
         pSplitWindow->SetItemSizeRange(
             nSetId,
-            Range(TabBar::GetDefaultWidth(), gnMaximumSidebarWidth));
+            Range(TabBar::GetDefaultWidth() + nWidth, gnMaximumSidebarWidth));
     }
 }
 
diff --git a/sfx2/source/sidebar/SidebarController.hxx b/sfx2/source/sidebar/SidebarController.hxx
index 5f2c82b..bdebeb8 100644
--- a/sfx2/source/sidebar/SidebarController.hxx
+++ b/sfx2/source/sidebar/SidebarController.hxx
@@ -213,7 +213,7 @@ private:
     void UpdateTitleBarIcons (void);
 
     void UpdateDeckOpenState (void);
-    void RestrictWidth (void);
+    void RestrictWidth (sal_Int32 nWidth);
     SfxSplitWindow* GetSplitWindow (void);
     void ProcessNewWidth (const sal_Int32 nNewWidth);
     void UpdateCloseIndicator (const bool bIsIndicatorVisible);
diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx
index 263e970..a4e037a 100644
--- a/sfx2/source/sidebar/SidebarPanelBase.cxx
+++ b/sfx2/source/sidebar/SidebarPanelBase.cxx
@@ -248,4 +248,15 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi
     return ui::LayoutSize(0,0,0);
 }
 
+sal_Int32 SAL_CALL SidebarPanelBase::getMinimalWidth () throw(cssu::RuntimeException)
+{
+    if (isLayoutEnabled(mpControl))
+    {
+        // widget layout-based sidebar
+        Size aSize(mpControl->GetOptimalSize());
+        return aSize.Width();
+    }
+    return 0;
+}
+
 } } // end of namespace sfx2::sidebar
commit 6d4cd686935f09756f9df7656a5b1f085f8bf89f
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Sun Jun 2 03:56:28 2013 +0200

    sidebar: Don't overlap widgets in the .ui based panels.
    
    Change-Id: I32c978188a38d54f2b05d40b5d47b9d5520f3cca
    (cherry picked from commit b441420e072a1f09098f89ed646e423c60e1895b)

diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 03ff130..568f151 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -26,6 +26,10 @@ Size PanelLayout::GetOptimalSize() const
 
 void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
 {
+    Size aSize(GetOptimalSize());
+    nWidth = std::max(nWidth,aSize.Width());
+    nHeight = std::max(nHeight,aSize.Height());
+
     Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
 
     if (isLayoutEnabled(this) && (nFlags & WINDOW_POSSIZE_SIZE))
commit 442d1e1f237668ec01ca4ffd5efba87ce221b09d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Sun Jun 2 02:10:34 2013 +0200

    sidebar: Convert TextPropertyPanel to .ui + adapt code.
    
    Change-Id: I1e446ca520b10f0fba4f79d2e840d10835850f66
    (cherry picked from commit 415b70061036e67e00786836856f7eeda8cea938)

diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 5b1e63d..9d347ef 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/redlinecontrol \
 	svx/uiconfig/ui/redlinefilterpage \
 	svx/uiconfig/ui/redlineviewpage \
+	svx/uiconfig/ui/sidebartextpanel \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/svx/source/sidebar/text/SvxSBFontNameBox.cxx b/svx/source/sidebar/text/SvxSBFontNameBox.cxx
index 1137617..f5ca5c3 100644
--- a/svx/source/sidebar/text/SvxSBFontNameBox.cxx
+++ b/svx/source/sidebar/text/SvxSBFontNameBox.cxx
@@ -93,6 +93,22 @@ SvxSBFontNameBox::SvxSBFontNameBox( Window* pParent,  const ResId& rResId  ) :
 //  StartListening( *SFX_APP() );
 }
 
+SvxSBFontNameBox::SvxSBFontNameBox( Window* pParent ) :
+    FontNameBox ( pParent, WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP|WB_DROPDOWN )
+,   pFontList   ( NULL )
+,   nFtCount    ( 0 )
+,   pBindings(NULL)
+{
+    EnableControls_Impl();
+    EnableAutoSize(true);
+//  StartListening( *SFX_APP() );
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxSBFontNameBox(Window *pParent)
+{
+    return new SvxSBFontNameBox(pParent);
+}
+
 void SvxSBFontNameBox::EnableControls_Impl()
 {
     SvtFontOptions aFontOpt;
diff --git a/svx/source/sidebar/text/SvxSBFontNameBox.hxx b/svx/source/sidebar/text/SvxSBFontNameBox.hxx
index 82289e3..7470f06 100644
--- a/svx/source/sidebar/text/SvxSBFontNameBox.hxx
+++ b/svx/source/sidebar/text/SvxSBFontNameBox.hxx
@@ -58,7 +58,8 @@ protected:
     virtual void    Select();
 
 public:
-    SvxSBFontNameBox( Window* pParent, const ResId& rResId  );
+    SvxSBFontNameBox( Window* pParent, const ResId& rResId );
+    SvxSBFontNameBox( Window* pParent );
     void            FillList();
     sal_uInt16 GetListCount() { return nFtCount; }
     void            Clear() { FontNameBox::Clear(); nFtCount = 0; }
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 258a730..abb05a5 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -63,6 +63,20 @@ using namespace cssu;
 using ::sfx2::sidebar::Theme;
 using ::sfx2::sidebar::ControlFactory;
 
+const char UNO_BACKCOLOR[] = ".uno:BackColor";
+const char UNO_BOLD[] = ".uno:Bold";
+const char UNO_COLOR[] = ".uno:Color";
+const char UNO_FONTCOLOR[] = ".uno:FontColor";
+const char UNO_GROW[] = ".uno:Grow";
+const char UNO_ITALIC[] = ".uno:Italic";
+const char UNO_STRIKEOUT[] = ".uno:Strikeout";
+const char UNO_SHADOWED[] = ".uno:Shadowed";
+const char UNO_SHRINK[] = ".uno:Shrink";
+const char UNO_SPACING[] = ".uno:Spacing";
+const char UNO_SUBSCRIPT[] = ".uno:SubScript";
+const char UNO_SUPERSCRIPT[] = ".uno:SuperScript";
+const char UNO_UNDERLINE[] = ".uno:Underline";
+
 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
 
 namespace svx { namespace sidebar {
@@ -116,52 +130,8 @@ TextPropertyPanel* TextPropertyPanel::Create (
     return maSpacingControl;
 }
 
-TextPropertyPanel::TextPropertyPanel (
-    Window* pParent,
-    const cssu::Reference<css::frame::XFrame>& rxFrame,
-    SfxBindings* pBindings,
-    const ::sfx2::sidebar::EnumContext& rContext)
-    :   Control(pParent, SVX_RES(RID_SIDEBAR_TEXT_PANEL)),
-        mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))),
-        maFontSizeBox       (this, SVX_RES(MB_SBFONT_FONTSIZE)),
-        mpToolBoxFontBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxFont(ControlFactory::CreateToolBox(
-                mpToolBoxFontBackground.get(),
-                SVX_RES(TB_FONT))),
-        mpToolBoxIncDecBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxIncDec(ControlFactory::CreateToolBox(
-                mpToolBoxIncDecBackground.get(),
-                SVX_RES(TB_INCREASE_DECREASE))),
-        mpToolBoxScriptBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxScript(ControlFactory::CreateToolBox(
-                mpToolBoxScriptBackground.get(),
-                SVX_RES(TB_SCRIPT))),
-        mpToolBoxScriptSwBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxScriptSw(ControlFactory::CreateToolBox(
-                mpToolBoxScriptSwBackground.get(),
-                SVX_RES(TB_SCRIPT_SW))),
-        mpToolBoxSpacingBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxSpacing(ControlFactory::CreateToolBox(
-                mpToolBoxSpacingBackground.get(),
-                SVX_RES(TB_SPACING))),
-        mpToolBoxFontColorBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxFontColor(ControlFactory::CreateToolBox(
-                mpToolBoxFontColorBackground.get(),
-                SVX_RES(TB_FONTCOLOR),
-                rxFrame)),
-        mpToolBoxFontColorBackgroundSW(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxFontColorSW(ControlFactory::CreateToolBox(
-                mpToolBoxFontColorBackgroundSW.get(),
-                SVX_RES(TB_FONTCOLOR_SW),
-                rxFrame)),
-        mpToolBoxHighlightBackground(ControlFactory::CreateToolBoxBackground(this)),
-        mpToolBoxHighlight(ControlFactory::CreateToolBox(
-                mpToolBoxHighlightBackground.get(),
-                SVX_RES(TB_HIGHLIGHT),
-                rxFrame)),
-        mpFontColorUpdater(),
-        mpHighlightUpdater(),
-
+TextPropertyPanel::TextPropertyPanel ( Window* pParent, const cssu::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, const ::sfx2::sidebar::EnumContext& rContext )
+    : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame),
         maFontNameControl   (SID_ATTR_CHAR_FONT,        *pBindings, *this, A2S("CharFontName"), rxFrame),
         maFontSizeControl   (SID_ATTR_CHAR_FONTHEIGHT,  *pBindings, *this, A2S("FontHeight"),   rxFrame),
         maWeightControl     (SID_ATTR_CHAR_WEIGHT,      *pBindings, *this, A2S("Bold"),         rxFrame),
@@ -182,13 +152,18 @@ TextPropertyPanel::TextPropertyPanel (
 
         maCharSpacePopup(this, ::boost::bind(&TextPropertyPanel::CreateCharacterSpacingControl, this, _1)),
         maUnderlinePopup(this, ::boost::bind(&TextPropertyPanel::CreateUnderlinePopupControl, this, _1)),
-        mxFrame(rxFrame),
         maContext(),
         mpBindings(pBindings)
 {
-    Initialize();
+    get(mpFontNameBox, "font");
+    get(mpFontSizeBox, "fontsize");
+    get(mpToolBoxFont, "fonteffects");
+    get(mpToolBoxIncDec, "fontadjust");
+    get(mpToolBoxScript, "position");
+    get(mpToolBoxSpacing, "spacingbar");
+    get(mpToolBoxFontColor, "colorbar");
 
-    FreeResource();
+    Initialize();
 
     UpdateFontColorToolbox(rContext);
 }
@@ -200,26 +175,6 @@ TextPropertyPanel::~TextPropertyPanel (void)
 {
     if(mbMustDelete)
         delete mpFontList;
-
-    // Destroy the toolbox windows.
-    mpToolBoxIncDec.reset();
-    mpToolBoxFont.reset();
-    mpToolBoxFontColor.reset();
-    mpToolBoxFontColorSW.reset();
-    mpToolBoxScript.reset();
-    mpToolBoxScriptSw.reset();
-    mpToolBoxSpacing.reset();
-    mpToolBoxHighlight.reset();
-
-    // Destroy the background windows of the toolboxes.
-    mpToolBoxIncDecBackground.reset();
-    mpToolBoxFontBackground.reset();
-    mpToolBoxFontColorBackground.reset();
-    mpToolBoxFontColorBackgroundSW.reset();
-    mpToolBoxScriptBackground.reset();
-    mpToolBoxScriptSwBackground.reset();
-    mpToolBoxSpacingBackground.reset();
-    mpToolBoxHighlightBackground.reset();
 }
 
 
@@ -245,34 +200,30 @@ void TextPropertyPanel::HandleContextChange (
     {
         case CombinedEnumContext(Application_Calc, Context_Cell):
         case CombinedEnumContext(Application_Calc, Context_Pivot):
-            mpToolBoxScriptSw->Hide();
-            mpToolBoxHighlight->Hide();
+            mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_BACKCOLOR));
             mpToolBoxScript->Disable();
             mpToolBoxSpacing->Disable();
             break;
 
         case CombinedEnumContext(Application_Calc, Context_EditCell):
         case CombinedEnumContext(Application_Calc, Context_DrawText):
-            mpToolBoxScriptSw->Hide();
-            mpToolBoxHighlight->Hide();
+            mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_BACKCOLOR));
             mpToolBoxScript->Enable();
             mpToolBoxSpacing->Enable();
             break;
 
         case CombinedEnumContext(Application_WriterVariants, Context_Text):
         case CombinedEnumContext(Application_WriterVariants, Context_Table):
-            mpToolBoxScriptSw->Show();
-            mpToolBoxScript->Hide();
-            mpToolBoxHighlight->Show();
+            mpToolBoxFontColor->ShowItem(mpToolBoxFontColor->GetItemId(UNO_BACKCOLOR));
+            mpToolBoxScript->Enable();
             mpToolBoxSpacing->Show();
             break;
 
         case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
         case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
-            mpToolBoxScriptSw->Show();
-            mpToolBoxScript->Hide();
+            mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_BACKCOLOR));
+            mpToolBoxScript->Enable();
             mpToolBoxSpacing->Show();
-            mpToolBoxHighlight->Hide();
             break;
 
         case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
@@ -282,10 +233,9 @@ void TextPropertyPanel::HandleContextChange (
         case CombinedEnumContext(Application_DrawImpress, Context_Draw):
         case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
         case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
-            mpToolBoxScriptSw->Hide();
-            mpToolBoxScript->Show();
+            mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_BACKCOLOR));
+            mpToolBoxScript->Enable();
             mpToolBoxSpacing->Show();
-            mpToolBoxHighlight->Hide();
             break;
 
         default:
@@ -307,13 +257,13 @@ void TextPropertyPanel::UpdateFontColorToolbox (
             bIsWriterFontColor = true;
     if (bIsWriterFontColor)
     {
-        mpToolBoxFontColor->Hide();
-        mpToolBoxFontColorSW->Show();
+        mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_COLOR));
+        mpToolBoxFontColor->ShowItem(mpToolBoxFontColor->GetItemId(UNO_FONTCOLOR));
     }
     else
     {
-        mpToolBoxFontColor->Show();
-        mpToolBoxFontColorSW->Hide();
+        mpToolBoxFontColor->ShowItem(mpToolBoxFontColor->GetItemId(UNO_COLOR));
+        mpToolBoxFontColor->HideItem(mpToolBoxFontColor->GetItemId(UNO_FONTCOLOR));
     }
 }
 
@@ -348,8 +298,8 @@ void TextPropertyPanel::Initialize (void)
 
     mpFontNameBox->SetAccessibleName(mpFontNameBox->GetQuickHelpText());
     const FontInfo aFontInfo (mpFontList->Get( OUString( "" ), OUString( "" )));
-    maFontSizeBox.Fill(&aFontInfo,mpFontList);
-    maFontSizeBox.SetAccessibleName(maFontSizeBox.GetQuickHelpText());
+    mpFontSizeBox->Fill(&aFontInfo,mpFontList);
+    mpFontSizeBox->SetAccessibleName(mpFontSizeBox->GetQuickHelpText());
 
     //toolbox
     SetupToolboxItems();
@@ -359,17 +309,15 @@ void TextPropertyPanel::Initialize (void)
     InitToolBoxSpacing();
 
 #ifdef HAS_IA2
-    mpFontNameBox->SetAccRelationLabeledBy(&mpFontNameBox);
-    mpFontNameBox->SetMpSubEditAccLableBy(&mpFontNameBox);
-    maFontSizeBox.SetAccRelationLabeledBy(&maFontSizeBox);
-    maFontSizeBox.SetMpSubEditAccLableBy(&maFontSizeBox);
-    mpToolBoxFont.SetAccRelationLabeledBy(&mpToolBoxFont);
-    mpToolBoxIncDec.SetAccRelationLabeledBy(&mpToolBoxIncDec);
-    mpToolBoxFontColor.SetAccRelationLabeledBy(&mpToolBoxFontColor);
-    mpToolBoxScript.SetAccRelationLabeledBy(&mpToolBoxScript);
-    mpToolBoxScriptSw.SetAccRelationLabeledBy(&mpToolBoxScriptSw);
-    mpToolBoxSpacing.SetAccRelationLabeledBy(&mpToolBoxSpacing);
-    mpToolBoxHighlight.SetAccRelationLabeledBy(&mpToolBoxHighlight);
+    mpFontNameBox->SetAccRelationLabeledBy(mpFontNameBox);
+    mpFontNameBox->SetMpSubEditAccLableBy(mpFontNameBox);
+    mpFontSizeBox->SetAccRelationLabeledBy(mpFontSizeBox);
+    mpFontSizeBox->SetMpSubEditAccLableBy(mpFontSizeBox);
+    mpToolBoxFont->SetAccRelationLabeledBy(mpToolBoxFont);
+    mpToolBoxIncDec->SetAccRelationLabeledBy(mpToolBoxIncDec);
+    mpToolBoxFontColor->SetAccRelationLabeledBy(mpToolBoxFontColor);
+    mpToolBoxScriptSetAccRelationLabeledBy(mpToolBoxScript);
+    mpToolBoxSpacing->SetAccRelationLabeledBy(mpToolBoxSpacing);
 #endif
 
     //init state
@@ -394,11 +342,11 @@ void TextPropertyPanel::Initialize (void)
     Link aLink = LINK(this, TextPropertyPanel, FontSelHdl);
     mpFontNameBox->SetSelectHdl(aLink);
     aLink = LINK(this, TextPropertyPanel, FontSizeModifyHdl);
-    maFontSizeBox.SetModifyHdl(aLink);
+    mpFontSizeBox->SetModifyHdl(aLink);
     aLink = LINK(this, TextPropertyPanel, FontSizeSelHdl);
-    maFontSizeBox.SetSelectHdl(aLink);
+    mpFontSizeBox->SetSelectHdl(aLink);
     aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
-    maFontSizeBox.SetLoseFocusHdl(aLink);
+    mpFontSizeBox->SetLoseFocusHdl(aLink);
 }
 
 void TextPropertyPanel::EndSpacingPopupMode (void)
@@ -414,14 +362,9 @@ void TextPropertyPanel::EndUnderlinePopupMode (void)
 
 void TextPropertyPanel::InitToolBoxFont()
 {
-    mpToolBoxFont->SetBackground(Wallpaper());
-    mpToolBoxFont->SetPaintTransparent(true);
-
-    Size aTbxSize( mpToolBoxFont->CalcWindowSizePixel() );
-    mpToolBoxFont->SetOutputSizePixel( aTbxSize );
-
-    Link aLink  = LINK(this, TextPropertyPanel, ToolboxFontSelectHandler);
+    Link aLink = LINK(this, TextPropertyPanel, ToolboxFontSelectHandler);
     mpToolBoxFont->SetSelectHdl ( aLink );
+
     aLink = LINK(this, TextPropertyPanel, ToolBoxUnderlineClickHdl);
     mpToolBoxFont->SetDropdownClickHdl(aLink);
 }
@@ -431,9 +374,6 @@ void TextPropertyPanel::InitToolBoxFont()
 
 void TextPropertyPanel::InitToolBoxIncDec()
 {
-    Size aTbxSize( mpToolBoxIncDec->CalcWindowSizePixel() );
-    mpToolBoxIncDec->SetOutputSizePixel( aTbxSize );
-
     Link aLink = LINK(this, TextPropertyPanel, ToolboxIncDecSelectHdl);
     mpToolBoxIncDec->SetSelectHdl ( aLink );
 }
@@ -443,23 +383,14 @@ void TextPropertyPanel::InitToolBoxIncDec()
 
 void TextPropertyPanel::InitToolBoxScript()
 {
-    Size aTbxSize( mpToolBoxScriptSw->CalcWindowSizePixel() );
-    mpToolBoxScriptSw->SetOutputSizePixel( aTbxSize );
-
-    Link aLink = LINK(this, TextPropertyPanel, ToolBoxSwScriptSelectHdl);
-    mpToolBoxScriptSw->SetSelectHdl ( aLink );
-
-    aTbxSize = mpToolBoxScript->CalcWindowSizePixel() ;
-    mpToolBoxScript->SetOutputSizePixel( aTbxSize );
-
-    aLink = LINK(this, TextPropertyPanel, ToolBoxScriptSelectHdl);
+    Link aLink = LINK(this, TextPropertyPanel, ToolBoxScriptSelectHdl);
     mpToolBoxScript->SetSelectHdl ( aLink );
 }
+
 void TextPropertyPanel::InitToolBoxSpacing()
 {
-    Size aTbxSize( mpToolBoxSpacing->CalcWindowSizePixel() );
-    mpToolBoxSpacing->SetOutputSizePixel( aTbxSize );
-    mpToolBoxSpacing->SetItemBits( TBI_SPACING, mpToolBoxSpacing->GetItemBits( TBI_SPACING ) | TIB_DROPDOWNONLY );
+    const sal_uInt16 nId = mpToolBoxSpacing->GetItemId(UNO_SPACING);
+    mpToolBoxSpacing->SetItemBits(nId, mpToolBoxSpacing->GetItemBits(nId) | TIB_DROPDOWNONLY);
 
     Link aLink = LINK(this, TextPropertyPanel, SpacingClickHdl);
     mpToolBoxSpacing->SetDropdownClickHdl ( aLink );
@@ -471,22 +402,19 @@ void TextPropertyPanel::InitToolBoxSpacing()
 
 void TextPropertyPanel::SetupToolboxItems (void)
 {
-    maSDFontGrow.SetupToolBoxItem(*mpToolBoxIncDec, TBI_INCREASE);
-    maSDFontShrink.SetupToolBoxItem(*mpToolBoxIncDec, TBI_DECREASE);
-
-    maWeightControl.SetupToolBoxItem(*mpToolBoxFont, TBI_BOLD);
-    maItalicControl.SetupToolBoxItem(*mpToolBoxFont, TBI_ITALIC);
-    maUnderlineControl.SetupToolBoxItem(*mpToolBoxFont, TBI_UNDERLINE);
-    maStrikeControl.SetupToolBoxItem(*mpToolBoxFont, TBI_STRIKEOUT);
-    maShadowControl.SetupToolBoxItem(*mpToolBoxFont, TBI_SHADOWED);
-
-    //for sw
-    maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUPER_SW);
-    maSubScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUB_SW);
-    //for sc and sd
-    maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUPER);
-    maSubScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUB);
-    maSpacingControl.SetupToolBoxItem(*mpToolBoxSpacing, TBI_SPACING);
+    maSDFontGrow.SetupToolBoxItem(*mpToolBoxIncDec, mpToolBoxIncDec->GetItemId(UNO_GROW));
+    maSDFontShrink.SetupToolBoxItem(*mpToolBoxIncDec, mpToolBoxIncDec->GetItemId(UNO_SHRINK));
+
+    maWeightControl.SetupToolBoxItem(*mpToolBoxFont, mpToolBoxFont->GetItemId(UNO_BOLD));
+    maItalicControl.SetupToolBoxItem(*mpToolBoxFont, mpToolBoxFont->GetItemId(UNO_ITALIC));
+    maUnderlineControl.SetupToolBoxItem(*mpToolBoxFont, mpToolBoxFont->GetItemId(UNO_UNDERLINE));
+    maStrikeControl.SetupToolBoxItem(*mpToolBoxFont, mpToolBoxFont->GetItemId(UNO_STRIKEOUT));
+    maShadowControl.SetupToolBoxItem(*mpToolBoxFont, mpToolBoxFont->GetItemId(UNO_SHADOWED));
+
+    maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScript, mpToolBoxScript->GetItemId(UNO_SUPERSCRIPT));
+    maSubScriptControl.SetupToolBoxItem(*mpToolBoxScript, mpToolBoxScript->GetItemId(UNO_SUBSCRIPT));
+
+    maSpacingControl.SetupToolBoxItem(*mpToolBoxSpacing, mpToolBoxSpacing->GetItemId(UNO_SPACING));
 }
 
 
@@ -509,7 +437,7 @@ IMPL_LINK( TextPropertyPanel, FontSelHdl, FontNameBox*, pBox )
 
 IMPL_LINK( TextPropertyPanel, FontSizeModifyHdl, FontSizeBox*, pSizeBox )
 {
-    if (pSizeBox == &maFontSizeBox)
+    if (pSizeBox == mpFontSizeBox)
     {
         long nSize = pSizeBox->GetValue();
         mbFocusOnFontSizeCtrl = true;
@@ -542,7 +470,7 @@ IMPL_LINK( TextPropertyPanel, FontSizeSelHdl, FontSizeBox*, pSizeBox )
 
 IMPL_LINK(TextPropertyPanel, FontSizeLoseFocus, FontSizeBox*, pSizeBox)
 {
-    if(pSizeBox == &maFontSizeBox)
+    if(pSizeBox == mpFontSizeBox)
     {
         mbFocusOnFontSizeCtrl = false;
     }
@@ -552,10 +480,9 @@ IMPL_LINK(TextPropertyPanel, FontSizeLoseFocus, FontSizeBox*, pSizeBox)
 IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
 {
     const sal_uInt16 nId = pToolBox->GetCurItemId();
+    const OUString aCommand(pToolBox->GetItemCommand(nId));
 
-    switch (nId)
-    {
-        case TBI_BOLD:
+        if (aCommand == UNO_BOLD)
         {
             EndTracking();
             if(meWeight != WEIGHT_BOLD)
@@ -565,9 +492,8 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
             SvxWeightItem aWeightItem(meWeight, SID_ATTR_CHAR_WEIGHT);
             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_WEIGHT, SFX_CALLMODE_RECORD, &aWeightItem, 0L);
             UpdateItem(SID_ATTR_CHAR_WEIGHT);
-            break;
         }
-        case TBI_ITALIC:
+        else if (aCommand == UNO_ITALIC)
         {
             EndTracking();
             if(meItalic != ITALIC_NORMAL)
@@ -577,9 +503,8 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
             SvxPostureItem aPostureItem(meItalic, SID_ATTR_CHAR_POSTURE);
             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_POSTURE, SFX_CALLMODE_RECORD, &aPostureItem, 0L);
             UpdateItem(SID_ATTR_CHAR_POSTURE);
-            break;
         }
-        case TBI_UNDERLINE:
+        else if (aCommand == UNO_UNDERLINE)
         {
             EndTracking();
             if(meUnderline == UNDERLINE_NONE)
@@ -596,9 +521,8 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
                 mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
             }
             UpdateItem(SID_ATTR_CHAR_UNDERLINE);
-            break;
         }
-        case TBI_STRIKEOUT:
+        else if (aCommand == UNO_STRIKEOUT)
         {
             EndTracking();
             if(meStrike !=  STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW)
@@ -608,18 +532,16 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
             SvxCrossedOutItem aStrikeItem(meStrike,SID_ATTR_CHAR_STRIKEOUT);
             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_STRIKEOUT, SFX_CALLMODE_RECORD, &aStrikeItem, 0L);
             UpdateItem(SID_ATTR_CHAR_STRIKEOUT);
-            break;
         }
-        case TBI_SHADOWED:
+        else if (aCommand == UNO_SHADOWED)
         {
             EndTracking();
             mbShadow = !mbShadow;
             SvxShadowedItem aShadowItem(mbShadow, SID_ATTR_CHAR_SHADOWED);
             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_SHADOWED, SFX_CALLMODE_RECORD, &aShadowItem, 0L);
             UpdateItem(SID_ATTR_CHAR_SHADOWED);
-            break;
         }
-    }
+
     return 0;
 }
 
@@ -629,6 +551,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
 IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
 {
     const sal_uInt16 nId = pToolBox->GetCurItemId();
+    const OUString aCommand(pToolBox->GetItemCommand(nId));
 
     // font size +/- enhancement in sd
     switch (maContext.GetCombinedContext_DI())
@@ -640,13 +563,13 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
         case CombinedEnumContext(Application_DrawImpress, Context_Draw):
         case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
         case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
-            if(nId == TBI_INCREASE)
+            if(aCommand == UNO_GROW)
             {
                 EndTracking();
                 SfxVoidItem aItem(SID_GROW_FONT_SIZE);
                 mpBindings->GetDispatcher()->Execute( SID_GROW_FONT_SIZE, SFX_CALLMODE_RECORD, &aItem, 0L );
             }
-            else if(nId == TBI_DECREASE)
+            else if(aCommand == UNO_SHRINK)
             {
                 EndTracking();
                 SfxVoidItem aItem(SID_SHRINK_FONT_SIZE);
@@ -655,15 +578,15 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
             break;
 
         default:
-            if(nId == TBI_INCREASE)
+            if(aCommand == UNO_GROW)
             {
                 EndTracking();
                 mbFocusOnFontSizeCtrl = false;
-                sal_Int64 iValue = maFontSizeBox.GetValue();
-                int iPos = maFontSizeBox.GetValuePos(iValue, FUNIT_NONE);
+                sal_Int64 iValue = mpFontSizeBox->GetValue();
+                int iPos = mpFontSizeBox->GetValuePos(iValue, FUNIT_NONE);
                 long nSize = iValue;
                 if(iPos != LISTBOX_ENTRY_NOTFOUND)
-                    nSize = maFontSizeBox.GetValue(iPos+1 , FUNIT_NONE);
+                    nSize = mpFontSizeBox->GetValue(iPos+1 , FUNIT_NONE);
                 else if(iValue >= 100 && iValue < 105)
                     nSize = 105;
                 else if(iValue >= 105 && iValue < 110)
@@ -671,7 +594,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
                 else if(iValue < 960)
                 {
                     nSize = (nSize / 10) * 10 + 10;
-                    while(maFontSizeBox.GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
+                    while(nSize < 960 && mpFontSizeBox->GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
                         nSize += 10;
                 }
                 else
@@ -686,17 +609,17 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
 
                 mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L );
                 mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
-                maFontSizeBox.SetValue( nSize );
+                mpFontSizeBox->SetValue( nSize );
             }
-            else if(nId == TBI_DECREASE)
+            else if(aCommand == UNO_SHRINK)
             {
                 EndTracking();
                 mbFocusOnFontSizeCtrl = false;
-                sal_Int64 iValue = maFontSizeBox.GetValue();
-                int iPos = maFontSizeBox.GetValuePos(iValue, FUNIT_NONE);
+                sal_Int64 iValue = mpFontSizeBox->GetValue();
+                int iPos = mpFontSizeBox->GetValuePos(iValue, FUNIT_NONE);
                 long nSize = iValue;
                 if(iPos != LISTBOX_ENTRY_NOTFOUND)
-                    nSize = maFontSizeBox.GetValue(iPos-1 , FUNIT_NONE);
+                    nSize = mpFontSizeBox->GetValue(iPos-1, FUNIT_NONE);
                 else if(iValue > 100 && iValue <= 105)
                     nSize = 100;
                 else if(iValue > 105 && iValue <= 110)
@@ -708,7 +631,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
                 else if(iValue > 60)
                 {
                     nSize = (nSize / 10) * 10 ;
-                    while(maFontSizeBox.GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
+                    while(nSize > 60 && mpFontSizeBox->GetValuePos(nSize, FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
                         nSize -= 10;
                 }
                 else
@@ -723,7 +646,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
 
                 mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L );
                 mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
-                maFontSizeBox.SetValue( nSize );
+                mpFontSizeBox->SetValue( nSize );
             }
     }
     UpdateItem(SID_ATTR_CHAR_FONTHEIGHT);
@@ -736,24 +659,27 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
 IMPL_LINK(TextPropertyPanel, ToolBoxUnderlineClickHdl, ToolBox*, pToolBox)
 {
     const sal_uInt16 nId = pToolBox->GetCurItemId();
-    OSL_ASSERT(nId == TBI_UNDERLINE);
-    if(nId == TBI_UNDERLINE)
+    const OUString aCommand(pToolBox->GetItemCommand(nId));
+
+    if (aCommand == UNO_UNDERLINE)
     {
         pToolBox->SetItemDown( nId, true );
         maUnderlinePopup.Rearrange(meUnderline);
         maUnderlinePopup.Show(*pToolBox);
-
     }
+
     return 0L;
 }
 
 
 
 
-IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox)
+IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
 {
     const sal_uInt16 nId = pToolBox->GetCurItemId();
-    if( nId == TBI_SUPER_SW )
+    const OUString aCommand(pToolBox->GetItemCommand(nId));
+
+    if (isWriter() && aCommand == UNO_SUPERSCRIPT)
     {
         if(meEscape != SVX_ESCAPEMENT_SUPERSCRIPT)
         {
@@ -767,8 +693,9 @@ IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox)
             SvxEscapementItem aNoneItem(0, 100, SID_ATTR_CHAR_ESCAPEMENT);
             mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aNoneItem, 0L );
         }
+        UpdateItem(SID_ATTR_CHAR_ESCAPEMENT);
     }
-    else if(TBI_SUB_SW == nId)
+    else if (isWriter() && aCommand == UNO_SUBSCRIPT)
     {
         if(meEscape != SVX_ESCAPEMENT_SUBSCRIPT)
         {
@@ -782,26 +709,16 @@ IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox)
             SvxEscapementItem aNoneItem(0, 100, SID_ATTR_CHAR_ESCAPEMENT);
             mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aNoneItem, 0L );
         }
+        UpdateItem(SID_ATTR_CHAR_ESCAPEMENT);
     }
-    UpdateItem(SID_ATTR_CHAR_ESCAPEMENT);
-
-    return 0;
-}
-
-
-
-
-IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
-{
-    const sal_uInt16 nId = pToolBox->GetCurItemId();
-    if( nId == TBI_SUPER )
+    else if (!isWriter() && aCommand == UNO_SUPERSCRIPT)
     {
         mbSuper = !mbSuper;
         SfxBoolItem aSupItem(SID_SET_SUPER_SCRIPT, mbSuper);
         mpBindings->GetDispatcher()->Execute( SID_SET_SUPER_SCRIPT, SFX_CALLMODE_RECORD, &aSupItem, 0L );
         UpdateItem(SID_SET_SUPER_SCRIPT);
     }
-    else if(TBI_SUB == nId)
+    else if (!isWriter() && aCommand == UNO_SUBSCRIPT)
     {
 
         mbSub = !mbSub;
@@ -809,6 +726,7 @@ IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
         mpBindings->GetDispatcher()->Execute( SID_SET_SUB_SCRIPT, SFX_CALLMODE_RECORD, &aSubItem, 0L );
         UpdateItem(SID_SET_SUB_SCRIPT);
     }
+
     return 0;
 }
 
@@ -818,14 +736,15 @@ IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
 IMPL_LINK(TextPropertyPanel, SpacingClickHdl, ToolBox*, pToolBox)
 {
     const sal_uInt16 nId = pToolBox->GetCurItemId();
-    OSL_ASSERT(nId == TBI_SPACING);
-    if(nId == TBI_SPACING)
+    const OUString aCommand(pToolBox->GetItemCommand(nId));
+
+    if (aCommand == UNO_SPACING)
     {
         pToolBox->SetItemDown( nId, true );
         maCharSpacePopup.Rearrange(mbKernLBAvailable,mbKernAvailable,mlKerning);
         maCharSpacePopup.Show(*pToolBox);
-
     }
+
     return 0L;
 }
 
@@ -840,7 +759,7 @@ void TextPropertyPanel::NotifyItemUpdate (
 {
     switch(nSID)
     {
-        case SID_ATTR_CHAR_FONT:
+    case SID_ATTR_CHAR_FONT:
         {
             bool bIsControlEnabled (bIsEnabled);
             if (  eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontItem) )
@@ -855,10 +774,12 @@ void TextPropertyPanel::NotifyItemUpdate (
                     bIsControlEnabled = false;
             }
             mpFontNameBox->Enable(bIsControlEnabled);
-            break;
         }
-        case SID_ATTR_CHAR_FONTHEIGHT:
+        break;
+    case SID_ATTR_CHAR_FONTHEIGHT:
         {
+            const sal_uInt16 nIncreaseId = mpToolBoxIncDec->GetItemId(UNO_GROW);
+            const sal_uInt16 nDecreaseId = mpToolBoxIncDec->GetItemId(UNO_SHRINK);
             bool bIsControlEnabled (bIsEnabled);
             if (  eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontHeightItem) )
             {
@@ -867,8 +788,8 @@ void TextPropertyPanel::NotifyItemUpdate (
                 const sal_Int64 nValue (CalcToPoint(mpHeightItem->GetHeight(), eUnit, 10 ));
                 mpToolBoxIncDec->Enable();
 
-                mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK);
-                mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK);
+                mpToolBoxIncDec->SetItemState(nIncreaseId, STATE_NOCHECK);
+                mpToolBoxIncDec->SetItemState(nDecreaseId, STATE_NOCHECK);
 
                 // For Writer we have to update the states of the
                 // increase and decrease buttons here, because we have
@@ -886,8 +807,8 @@ void TextPropertyPanel::NotifyItemUpdate (
 
                     default:
                     {
-                        mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nValue<960);
-                        mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nValue>60);
+                        mpToolBoxIncDec->EnableItem(nIncreaseId, bIsEnabled && nValue<960);
+                        mpToolBoxIncDec->EnableItem(nDecreaseId, bIsEnabled && nValue>60);
                         break;
                     }
                 }
@@ -895,8 +816,8 @@ void TextPropertyPanel::NotifyItemUpdate (
                 if( mbFocusOnFontSizeCtrl )
                     return;
 
-                maFontSizeBox.SetValue(nValue);
-                maFontSizeBox.LoseFocus();
+                mpFontSizeBox->SetValue(nValue);
+                mpFontSizeBox->LoseFocus();
 
                 UpdateItem(SID_SHRINK_FONT_SIZE);
                 UpdateItem(SID_GROW_FONT_SIZE);
@@ -904,7 +825,7 @@ void TextPropertyPanel::NotifyItemUpdate (
             else
             {
                 mpHeightItem = NULL;
-                maFontSizeBox.SetText( String() );
+                mpFontSizeBox->SetText( String() );
                 //increase decrease diabled when multi-seletion have different font size
 
                 // font size +/- enhancement in sd
@@ -925,11 +846,11 @@ void TextPropertyPanel::NotifyItemUpdate (
                 if ( eState <= SFX_ITEM_READONLY )
                     bIsControlEnabled = false;
             }
-            maFontSizeBox.Enable(bIsControlEnabled);
-            break;
+            mpFontSizeBox->Enable(bIsControlEnabled);
         }
-
-        case SID_ATTR_CHAR_WEIGHT:
+        break;
+    case SID_ATTR_CHAR_WEIGHT:
+        {
             mbWeightAvailable = (eState >= SFX_ITEM_DONTCARE);
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxWeightItem))
             {
@@ -940,11 +861,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meWeight = WEIGHT_NORMAL;
             }
-            mpToolBoxFont->EnableItem(TBI_BOLD, mbWeightAvailable && bIsEnabled);
-            mpToolBoxFont->SetItemState(TBI_BOLD, meWeight==WEIGHT_BOLD ? STATE_CHECK : STATE_NOCHECK);
-            break;
-
-        case SID_ATTR_CHAR_POSTURE:
+            const sal_uInt16 nId = mpToolBoxFont->GetItemId(UNO_BOLD);
+            mpToolBoxFont->EnableItem(nId, mbWeightAvailable && bIsEnabled);
+            mpToolBoxFont->SetItemState(nId, meWeight==WEIGHT_BOLD ? STATE_CHECK : STATE_NOCHECK);
+        }
+        break;
+    case SID_ATTR_CHAR_POSTURE:
+        {
             mbPostureAvailable = (eState >= SFX_ITEM_DONTCARE);
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxPostureItem))
             {
@@ -955,11 +878,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meItalic = ITALIC_NONE;
             }
-            mpToolBoxFont->EnableItem(TBI_ITALIC, mbPostureAvailable && bIsEnabled);
-            mpToolBoxFont->SetItemState(TBI_ITALIC, meItalic==ITALIC_NORMAL ? STATE_CHECK : STATE_NOCHECK);
-            break;
-
-        case SID_ATTR_CHAR_UNDERLINE:
+            const sal_uInt16 nId = mpToolBoxFont->GetItemId(UNO_ITALIC);
+            mpToolBoxFont->EnableItem(nId, mbPostureAvailable && bIsEnabled);
+            mpToolBoxFont->SetItemState(nId, meItalic==ITALIC_NORMAL ? STATE_CHECK : STATE_NOCHECK);
+        }
+        break;
+    case SID_ATTR_CHAR_UNDERLINE:
+        {
             if( eState >= SFX_ITEM_DEFAULT)
             {
                 if(pState->ISA(SvxUnderlineItem))
@@ -973,11 +898,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meUnderline = UNDERLINE_NONE;
             }
-            mpToolBoxFont->EnableItem(TBI_UNDERLINE, bIsEnabled);
-            mpToolBoxFont->SetItemState(TBI_UNDERLINE, meUnderline==UNDERLINE_NONE ? STATE_NOCHECK : STATE_CHECK);
-            break;
-
-        case SID_ATTR_CHAR_SHADOWED:
+            const sal_uInt16 nId = mpToolBoxFont->GetItemId(UNO_UNDERLINE);
+            mpToolBoxFont->EnableItem(nId, bIsEnabled);
+            mpToolBoxFont->SetItemState(nId, meUnderline==UNDERLINE_NONE ? STATE_NOCHECK : STATE_CHECK);
+        }
+        break;
+    case SID_ATTR_CHAR_SHADOWED:
+        {
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxShadowedItem))
             {
                 const SvxShadowedItem* pItem = (const SvxShadowedItem*)pState;
@@ -987,11 +914,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 mbShadow = false;
             }
-            mpToolBoxFont->EnableItem(TBI_SHADOWED, bIsEnabled);
-            mpToolBoxFont->SetItemState(TBI_SHADOWED, mbShadow ? STATE_CHECK : STATE_NOCHECK);
-            break;
-
-        case SID_ATTR_CHAR_STRIKEOUT:
+            const sal_uInt16 nId = mpToolBoxFont->GetItemId(UNO_SHADOWED);
+            mpToolBoxFont->EnableItem(nId, bIsEnabled);
+            mpToolBoxFont->SetItemState(nId, mbShadow ? STATE_CHECK : STATE_NOCHECK);
+        }
+        break;
+    case SID_ATTR_CHAR_STRIKEOUT:
+        {
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxCrossedOutItem))
             {
                 const SvxCrossedOutItem* pItem = (const SvxCrossedOutItem*)pState;
@@ -1001,16 +930,20 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meStrike = STRIKEOUT_NONE;
             }
-            mpToolBoxFont->EnableItem(TBI_STRIKEOUT, bIsEnabled);
-            mpToolBoxFont->SetItemState(TBI_STRIKEOUT,
+            const sal_uInt16 nId = mpToolBoxFont->GetItemId(UNO_STRIKEOUT);
+            mpToolBoxFont->EnableItem(nId, bIsEnabled);
+            mpToolBoxFont->SetItemState(nId,
                 meStrike!=STRIKEOUT_NONE && meStrike!=STRIKEOUT_DONTKNOW
                     ? STATE_CHECK
                     : STATE_NOCHECK);
-            break;
-
-        case SID_ATTR_CHAR_ESCAPEMENT:
+        }
+        break;
+    case SID_ATTR_CHAR_ESCAPEMENT:
+        if (isWriter())
         {
             bool bIsItemEnabled (true);
+            const sal_uInt16 nSuperscriptId = mpToolBoxScript->GetItemId(UNO_SUPERSCRIPT);
+            const sal_uInt16 nSubscriptId = mpToolBoxScript->GetItemId(UNO_SUBSCRIPT);
             if (eState == SFX_ITEM_AVAILABLE)
             {
                 if (pState->ISA(SvxEscapementItem))
@@ -1020,27 +953,27 @@ void TextPropertyPanel::NotifyItemUpdate (
                     if(nEsc == 0)
                     {
                         meEscape = SVX_ESCAPEMENT_OFF;
-                        mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
-                        mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+                        mpToolBoxScript->SetItemState(nSuperscriptId, STATE_NOCHECK);
+                        mpToolBoxScript->SetItemState(nSubscriptId, STATE_NOCHECK);
                     }
                     else if(nEsc > 0)
                     {
                         meEscape = SVX_ESCAPEMENT_SUPERSCRIPT;
-                        mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_CHECK);
-                        mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+                        mpToolBoxScript->SetItemState(nSuperscriptId, STATE_CHECK);
+                        mpToolBoxScript->SetItemState(nSubscriptId, STATE_NOCHECK);
                     }
                     else
                     {
                         meEscape = SVX_ESCAPEMENT_SUBSCRIPT;
-                        mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
-                        mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_CHECK);
+                        mpToolBoxScript->SetItemState(nSuperscriptId, STATE_NOCHECK);
+                        mpToolBoxScript->SetItemState(nSubscriptId, STATE_CHECK);
                     }
                 }
                 else
                 {
                     meEscape = SVX_ESCAPEMENT_OFF;
-                    mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
-                    mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+                    mpToolBoxScript->SetItemState(nSuperscriptId, STATE_NOCHECK);
+                    mpToolBoxScript->SetItemState(nSubscriptId, STATE_NOCHECK);
                 }
             }
             else if (eState == SFX_ITEM_DISABLED)
@@ -1051,12 +984,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 meEscape = SVX_ESCAPEMENT_OFF;
             }
-            mpToolBoxScriptSw->EnableItem(TBI_SUPER_SW, bIsItemEnabled && bIsEnabled);
-            mpToolBoxScriptSw->EnableItem(TBI_SUB_SW, bIsItemEnabled && bIsEnabled);
-            break;
+            mpToolBoxScript->EnableItem(nSuperscriptId, bIsItemEnabled && bIsEnabled);
+            mpToolBoxScript->EnableItem(nSubscriptId, bIsItemEnabled && bIsEnabled);
         }
-
-        case SID_SET_SUB_SCRIPT:
+        break;
+    case SID_SET_SUB_SCRIPT:
+        if (!isWriter())
+        {
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem))
             {
                 const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
@@ -1066,11 +1000,14 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 mbSub = false;
             }
-            mpToolBoxScript->EnableItem(TBI_SUB, bIsEnabled);
-            mpToolBoxScript->SetItemState(TBI_SUB, mbSub ? STATE_CHECK : STATE_NOCHECK);
-            break;
-
-        case SID_SET_SUPER_SCRIPT:
+            const sal_uInt16 nSubscriptId = mpToolBoxScript->GetItemId(UNO_SUBSCRIPT);
+            mpToolBoxScript->EnableItem(nSubscriptId, bIsEnabled);
+            mpToolBoxScript->SetItemState(nSubscriptId, mbSub ? STATE_CHECK : STATE_NOCHECK);
+        }
+        break;
+    case SID_SET_SUPER_SCRIPT:
+        if (!isWriter())
+        {
             if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem))
             {
                 const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
@@ -1080,11 +1017,13 @@ void TextPropertyPanel::NotifyItemUpdate (
             {
                 mbSuper = false;
             }
-            mpToolBoxScript->EnableItem(TBI_SUPER, bIsEnabled);
-            mpToolBoxScript->SetItemState(TBI_SUPER, mbSuper ? STATE_CHECK : STATE_NOCHECK);
-            break;
-
-        case SID_ATTR_CHAR_KERNING:
+            const sal_uInt16 nSuperscriptId = mpToolBoxScript->GetItemId(UNO_SUPERSCRIPT);
+            mpToolBoxScript->EnableItem(nSuperscriptId, bIsEnabled);
+            mpToolBoxScript->SetItemState(nSuperscriptId, mbSuper ? STATE_CHECK : STATE_NOCHECK);
+        }
+        break;
+    case SID_ATTR_CHAR_KERNING:
+        {
             if ( SFX_ITEM_AVAILABLE == eState )
             {
                 mbKernLBAvailable = true;
@@ -1113,12 +1052,12 @@ void TextPropertyPanel::NotifyItemUpdate (
                 mbKernAvailable = false;
                 mlKerning = 0;
             }
-            mpToolBoxSpacing->EnableItem(TBI_SPACING, bIsEnabled);
-            break;
-
-            // font size +/- enhancement in sd
-        case SID_SHRINK_FONT_SIZE:
-        case SID_GROW_FONT_SIZE:
+            mpToolBoxSpacing->EnableItem(mpToolBoxSpacing->GetItemId(UNO_SPACING), bIsEnabled);
+        }
+        break;
+    case SID_SHRINK_FONT_SIZE:
+    case SID_GROW_FONT_SIZE:
+        {
             switch(maContext.GetCombinedContext_DI())
             {
                 case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
@@ -1133,15 +1072,15 @@ void TextPropertyPanel::NotifyItemUpdate (
                         mpToolBoxIncDec->Disable();
                     else
                         mpToolBoxIncDec->Enable();
-                    const sal_Int64 nSize (maFontSizeBox.GetValue());
+                    const sal_Int64 nSize (mpFontSizeBox->GetValue());
                     switch(nSID)
                     {
                         case SID_GROW_FONT_SIZE:
-                            mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
+                            mpToolBoxIncDec->EnableItem(mpToolBoxIncDec->GetItemId(UNO_GROW), bIsEnabled && nSize<960);
                             break;
 
                         case SID_SHRINK_FONT_SIZE:
-                            mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
+                            mpToolBoxIncDec->EnableItem(mpToolBoxIncDec->GetItemId(UNO_SHRINK), bIsEnabled && nSize>60);
                             break;
 
                         default:
@@ -1149,7 +1088,8 @@ void TextPropertyPanel::NotifyItemUpdate (
                     }
                 }
             }
-            break;
+        }
+        break;
     }
 }
 
@@ -1216,6 +1156,18 @@ void TextPropertyPanel::SetUnderline(FontUnderline  eUnderline)
     meUnderline = eUnderline;
 }
 
-
+bool TextPropertyPanel::isWriter()
+{
+    switch (maContext.GetCombinedContext_DI())
+    {
+        case CombinedEnumContext(Application_WriterVariants, Context_Text):
+        case CombinedEnumContext(Application_WriterVariants, Context_Table):
+        case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+        case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+            return true;
+        default:
+            return false;
+    }
+}
 
 } } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hrc b/svx/source/sidebar/text/TextPropertyPanel.hrc
index 36fc250..38baa07 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hrc
+++ b/svx/source/sidebar/text/TextPropertyPanel.hrc
@@ -24,32 +24,6 @@
 #define CUSTOM_Y                OFFSET_Y + POPUPPANEL_MARGIN_SMALL * 3 + 15 * 6 + TEXT_HEIGHT
 #define VS_UNDERLINE_WIDTH  57
 #define VS_UNDERLINE_HEIGHT  12 * 10
-//#define FT_TEST                   1
-#define CB_SBFONT_FONT          2
-#define MB_SBFONT_FONTSIZE      3
-#define TB_FONT                 4
-#define TB_INCREASE_DECREASE    5
-#define TB_FONTCOLOR            6
-#define TB_FONTCOLOR_SW         7
-#define TB_HIGHLIGHT            8
-#define TB_SPACING              9
-#define TB_SCRIPT               10
-#define TB_SCRIPT_SW            11
-
-#define TBI_FONTCOLOR           50
-#define TBI_BOLD                51
-#define TBI_ITALIC              52
-#define TBI_UNDERLINE           53
-#define TBI_STRIKEOUT           54
-#define TBI_SHADOWED            55
-#define TBI_INCREASE            56
-#define TBI_DECREASE            57
-#define TBI_HIGHLIGHT           58
-#define TBI_SUPER               59
-#define TBI_SUB                 60
-#define TBI_SUPER_SW            61
-#define TBI_SUB_SW              62
-#define TBI_SPACING             63
 
 #define IMG_SPACING_D               71
 
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 7f2f641..342b9a9 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -36,6 +36,7 @@
 #include "TextCharacterSpacingPopup.hxx"
 #include "TextUnderlinePopup.hxx"
 #include <svx/sidebar/ColorPopup.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
 #include <vcl/vclenum.hxx>
 
 class FloatingWindow;
@@ -48,7 +49,7 @@ class PopupControl;
 class PopupContainer;
 
 class TextPropertyPanel
-    : public Control,
+    : public PanelLayout,
       public ::sfx2::sidebar::IContextChangeReceiver,
       public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
@@ -83,26 +84,13 @@ public:
 
 private:
     //ui controls
-    ::boost::scoped_ptr<SvxSBFontNameBox> mpFontNameBox;
-    FontSizeBox maFontSizeBox;
-    ::boost::scoped_ptr<Window> mpToolBoxFontBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxFont;
-    ::boost::scoped_ptr<Window> mpToolBoxIncDecBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxIncDec;
-    ::boost::scoped_ptr<Window> mpToolBoxScriptBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxScript;
-    ::boost::scoped_ptr<Window> mpToolBoxScriptSwBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxScriptSw;
-    ::boost::scoped_ptr<Window> mpToolBoxSpacingBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxSpacing;
-    ::boost::scoped_ptr<Window> mpToolBoxFontColorBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxFontColor;
-    ::boost::scoped_ptr<Window> mpToolBoxFontColorBackgroundSW;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxFontColorSW;
-    ::boost::scoped_ptr<Window> mpToolBoxHighlightBackground;
-    ::boost::scoped_ptr<ToolBox> mpToolBoxHighlight;
-    ::boost::scoped_ptr<ToolboxButtonColorUpdater> mpFontColorUpdater;
-    ::boost::scoped_ptr<ToolboxButtonColorUpdater> mpHighlightUpdater;
+    SvxSBFontNameBox* mpFontNameBox;
+    FontSizeBox* mpFontSizeBox;
+    ToolBox* mpToolBoxFont;
+    ToolBox* mpToolBoxIncDec;
+    ToolBox* mpToolBoxScript;
+    ToolBox* mpToolBoxSpacing;
+    ToolBox* mpToolBoxFontColor;
 
     //control items
     ::sfx2::sidebar::ControllerItem maFontNameControl;
@@ -141,7 +129,6 @@ private:
     TextCharacterSpacingPopup maCharSpacePopup;
     TextUnderlinePopup maUnderlinePopup;
 
-    cssu::Reference<css::frame::XFrame> mxFrame;
     ::sfx2::sidebar::EnumContext maContext;
     SfxBindings* mpBindings;
 
@@ -171,7 +158,6 @@ private:
     DECL_LINK(FontSizeLoseFocus, FontSizeBox *);
     DECL_LINK(ToolboxFontSelectHandler, ToolBox *);
     DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *);
-    DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *);
     DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
 
     void UpdateItem (const sal_uInt16 nSlotId);
@@ -182,6 +168,8 @@ private:
     */
     void UpdateFontColorToolbox (
         const ::sfx2::sidebar::EnumContext aContext);
+
+    bool isWriter();
 };
 
 } } // end of namespace ::svx::sidebar
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index fcd10da..f22a899 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -19,255 +19,6 @@
 #include <sfx2/sidebar/ResourceDefinitions.hrc>
 #include "helpid.hrc"
 
-#define CONTROL_HEIGHT_FONT_NAME        250
-#define CONTROL_HEIGHT_FONT_SIZE        180
-#define FONTSIZE_WIDTH                  (TOOLBOX_ITEM_WIDTH * 2 - 1)
-#define FONTNAME_WIDTH                  (PROPERTYPAGE_WIDTH - (FONTSIZE_WIDTH) - 6)
-
-#define TB_SPACE                18
-#define TB_SPACE_V              4
-#define TEXT_WIDTH              TOOLBOX_42_42_ITEM_DD_WIDTH + TB_SPACE - 3
-
-#define FT_TB_SPACE             1
-#define BK_IMG                  20
-
-#define X0                      SECTIONPAGE_MARGIN_HORIZONTAL
-#define X1                      SECTIONPAGE_MARGIN_HORIZONTAL + 1 + TOOLBOX_ITEM_WIDTH * 2  + 4
-#define X2                      (PROPERTYPAGE_WIDTH - (FONTSIZE_WIDTH))
-#define X3                      (X2 - (TOOLBOX_ITEM_DD_WIDTH) - 2)
-
-#define FIRST_LINE_Y            SECTIONPAGE_MARGIN_VERTICAL_TOP
-#define SECOND_LINE_Y           FIRST_LINE_Y + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL  + 1
-#define THIRD_LINE_Y            SECOND_LINE_Y + CONTROL_SPACING_VERTICAL + (TOOLBOX_ITEM_HEIGHT + 2)
-
-
-Control RID_SIDEBAR_TEXT_PANEL
-{
-    OutputSize = TRUE;
-    DialogControl = TRUE;
-    Border = FALSE;
-
-    Size = MAP_APPFONT( PROPERTYPAGE_WIDTH, SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + TOOLBOX_ITEM_HEIGHT * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT );
-    HelpID = HID_PROPERTYPANEL_TEXT_SECTION ;
-    Text = "Text";
-
-    ComboBox CB_SBFONT_FONT
-    {
-        Border = TRUE;
-        Pos = MAP_APPFONT (X0 , FIRST_LINE_Y);
-        Size = MAP_APPFONT (FONTNAME_WIDTH , CONTROL_HEIGHT_FONT_NAME);
-        TabStop = TRUE;
-        DropDown = TRUE;
-        HelpID = HID_COMBO_FONT_NAME ;
-        QuickHelpText [ en-US ] = "Font";
-//        Command = ".uno:CharFontName";
-    };
-    MetricBox MB_SBFONT_FONTSIZE
-    {
-        Border = TRUE;
-        Pos = MAP_APPFONT (X2, FIRST_LINE_Y);
-        Size = MAP_APPFONT (FONTSIZE_WIDTH, CONTROL_HEIGHT_FONT_SIZE);
-        TabStop = TRUE;
-        DropDown = TRUE;
-        HelpID = HID_METRIC_FONT_SIZE;
-        QuickHelpText [ en-US ] = "Font Size";
-//        Command = ".uno:FontHeight";
-    };
-
-    ToolBox TB_INCREASE_DECREASE
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X2, SECOND_LINE_Y) ;
-        Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONTSIZE_INDE;
-        Text = "Font Size Adjusting" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_INCREASE;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_INCREASE;
-                Command = ".uno:Grow";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_DECREASE;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_DECREASE;
-                Command = ".uno:Shrink";
-            };
-        };
-    };
-    ToolBox TB_FONT
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X0 + 1, SECOND_LINE_Y) ;
-        Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 4 + TOOLBOX_ITEM_DD_WIDTH, TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT;
-        Text = "Font Effects" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_BOLD;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_BOLD;
-                Command = ".uno:Bold";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_ITALIC;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_ITALIC;
-                Command = ".uno:Italic";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_UNDERLINE;
-                DropDown = TRUE ;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_UNDERLINE;
-                Command = ".uno:Underline";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_STRIKEOUT;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_STRIKEOUT;
-                Command = ".uno:Strikeout";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_SHADOWED;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SHADOWED;
-                Command = ".uno:Shadowed";
-            };
-        };
-    };
-
-    ToolBox TB_FONTCOLOR
-    {
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT_COLOR;
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X3, THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_FONTCOLOR ;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
-                DropDown = TRUE ;
-                Command = ".uno:Color";
-            };
-        };
-    };
-    ToolBox TB_FONTCOLOR_SW
-    {
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT_COLOR;
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X3, THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_FONTCOLOR ;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
-                DropDown = TRUE ;
-                Command = ".uno:FontColor";
-            };
-        };
-    };
-
-    ToolBox TB_HIGHLIGHT
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X2, THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_HIGHLIGHT_COLOR;
-        Text = "Highlight Color" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_HIGHLIGHT ;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_HIGHLIGHT_COLOR;
-                DropDown = TRUE ;
-                Command = ".uno:BackColor";
-            };
-        };
-    };
-
-    ToolBox TB_SCRIPT_SW
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X0 + 1 , THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT_SW;
-        Text = "Font Position" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_SUPER_SW;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER_SW;
-                Command = ".uno:SuperScript";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_SUB_SW;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB_SW;
-                Command = ".uno:SubScript";
-            };
-        };
-    };
-    ToolBox TB_SCRIPT
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X0 + 1 , THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT;
-        Text = "Font Position" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_SUPER;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER;
-                Command = ".uno:SuperScript";
-            };
-            ToolBoxItem
-            {
-                Identifier = TBI_SUB;
-                HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB;
-                Command = ".uno:SubScript";
-            };
-        };
-    };
-
-    ToolBox TB_SPACING
-    {
-        SVLook = TRUE ;
-        Pos = MAP_APPFONT (X1, THIRD_LINE_Y) ;
-        Size = MAP_APPFONT (TOOLBOX_24_16_ITEM_DD_WIDTH, TOOLBOX_24_16_ITEM_HEIGHT ) ;
-        TabStop = TRUE ;
-        HelpID = HID_TB_SPACING;
-        Text = "Character Spacing" ;
-        ItemList =
-        {
-            ToolBoxItem
-            {
-                Identifier = TBI_SPACING;
-                DropDown = TRUE ;
-                HelpID = HID_TBI_SPACING;
-                Command = ".uno:Spacing";
-            };
-        };
-    };
-};
 
 Control RID_POPUPPANEL_TEXTPAGE_UNDERLINE
 {
diff --git a/svx/uiconfig/ui/sidebartextpanel.ui b/svx/uiconfig/ui/sidebartextpanel.ui
new file mode 100644
index 0000000..4f76438
--- /dev/null
+++ b/svx/uiconfig/ui/sidebartextpanel.ui
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkGrid" id="SidebarTextPanel">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="row_homogeneous">True</property>
+    <property name="column_homogeneous">True</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">6</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkBox" id="box2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">12</property>
+            <child>
+              <object class="svxlo-SvxSBFontNameBox" id="font">
+                <property name="width_request">150</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="svtlo-FontSizeBox" id="fontsize">
+                <property name="width_request">50</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">12</property>
+            <child>
+              <object class="sfxlo-SidebarToolBox" id="fonteffects">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="show_arrow">False</property>
+                <child>
+                  <object class="GtkToolButton" id="bold">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Bold</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="italic">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Italic</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkMenuToolButton" id="underline">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Underline</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="strikeout">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Strikeout</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="shadowed">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Shadowed</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="sfxlo-SidebarToolBox" id="fontadjust">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="show_arrow">False</property>
+                <child>
+                  <object class="GtkToolButton" id="grow">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Grow</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="shrink">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="is_important">True</property>
+                    <property name="action_name">.uno:Shrink</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list