You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2013/05/27 14:55:38 UTC

svn commit: r1486603 - in /openoffice/trunk/main: sfx2/inc/sfx2/sidebar/EnumContext.hxx sfx2/source/sidebar/EnumContext.cxx svx/source/sidebar/text/TextPropertyPanel.cxx svx/source/sidebar/text/TextPropertyPanel.hxx

Author: af
Date: Mon May 27 12:55:37 2013
New Revision: 1486603

URL: http://svn.apache.org/r1486603
Log:
122387: Use the right tool box for font color in text sidebar.

Modified:
    openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx
    openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx
    openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx
    openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx

Modified: openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx?rev=1486603&r1=1486602&r2=1486603&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx (original)
+++ openoffice/trunk/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx Mon May 27 12:55:37 2013
@@ -133,6 +133,7 @@ public:
     Application GetApplication_DI (void) const;
 
     const ::rtl::OUString& GetContextName (void) const;
+    Context GetContext (void) const;
 
     bool operator == (const EnumContext aOther);
     bool operator != (const EnumContext aOther);

Modified: openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx?rev=1486603&r1=1486602&r2=1486603&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/EnumContext.cxx Mon May 27 12:55:37 2013
@@ -142,6 +142,14 @@ const ::rtl::OUString& EnumContext::GetC
 
 
 
+EnumContext::Context EnumContext::GetContext (void) const
+{
+    return meContext;
+}
+
+
+
+
 bool EnumContext::operator== (const EnumContext aOther)
 {
     return meApplication==aOther.meApplication

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx?rev=1486603&r1=1486602&r2=1486603&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.cxx Mon May 27 12:55:37 2013
@@ -161,10 +161,13 @@ TextPropertyPanel::TextPropertyPanel (
         mpToolBoxFontColorBackground(ControlFactory::CreateToolBoxBackground(this)),
         mpToolBoxFontColor(ControlFactory::CreateToolBox(
                 mpToolBoxFontColorBackground.get(),
-                rContext.GetApplication_DI() == sfx2::sidebar::EnumContext::Application_WriterVariants
-                    ? SVX_RES(TB_FONTCOLOR_SW)
-                    : SVX_RES(TB_FONTCOLOR),
-                rxFrame)),		
+                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(),
@@ -199,6 +202,8 @@ TextPropertyPanel::TextPropertyPanel (
 	Initialize();
 
 	FreeResource();
+
+    UpdateFontColorToolbox(rContext);
 }
 
 
@@ -213,6 +218,7 @@ TextPropertyPanel::~TextPropertyPanel (v
     mpToolBoxIncDec.reset();
     mpToolBoxFont.reset();
     mpToolBoxFontColor.reset();
+    mpToolBoxFontColorSW.reset();
     mpToolBoxScript.reset();
     mpToolBoxScriptSw.reset();
     mpToolBoxSpacing.reset();
@@ -222,6 +228,7 @@ TextPropertyPanel::~TextPropertyPanel (v
     mpToolBoxIncDecBackground.reset();
     mpToolBoxFontBackground.reset();
     mpToolBoxFontColorBackground.reset();
+    mpToolBoxFontColorBackgroundSW.reset();
     mpToolBoxScriptBackground.reset();
     mpToolBoxScriptSwBackground.reset();
     mpToolBoxSpacingBackground.reset();
@@ -297,6 +304,30 @@ void TextPropertyPanel::HandleContextCha
         default:
             break;
     }
+
+    UpdateFontColorToolbox(aContext);
+}
+
+
+
+
+void TextPropertyPanel::UpdateFontColorToolbox (
+    const ::sfx2::sidebar::EnumContext aContext)
+{
+    bool bIsWriterFontColor (false);
+    if (maContext.GetApplication_DI() == sfx2::sidebar::EnumContext::Application_WriterVariants)
+        if (maContext.GetContext() != sfx2::sidebar::EnumContext::Context_DrawText)
+            bIsWriterFontColor = true;
+    if (bIsWriterFontColor)
+    {
+        mpToolBoxFontColor->Hide();
+        mpToolBoxFontColorSW->Show();
+    }
+    else
+    {
+        mpToolBoxFontColor->Show();
+        mpToolBoxFontColorSW->Hide();
+    }
 }
 
 

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx?rev=1486603&r1=1486602&r2=1486603&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hxx Mon May 27 12:55:37 2013
@@ -101,6 +101,8 @@ private:
     ::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;
@@ -177,6 +179,13 @@ private:
     DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
 
     void UpdateItem (const sal_uInt16 nSlotId);
+
+    /** Depending on the given context make one of the toolboxes
+        mpToolBoxFontColor and mpToolBoxFontColorSW visible.  Both
+        occupy the same space.
+    */
+    void UpdateFontColorToolbox (
+        const ::sfx2::sidebar::EnumContext aContext);
 };
 
 } } // end of namespace ::svx::sidebar