Author: alg
Date: Wed Apr  3 11:36:15 2013
New Revision: 1463926

URL: http://svn.apache.org/r1463926
Log:
i121789 Corrected ColorControl and 'no color' handling, adapted some DropDown 
sizes

Modified:
    
openoffice/branches/sidebar/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
    
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
    
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.src
    openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ColorControl.hxx
    
openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx
    
openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
    openoffice/branches/sidebar/main/svx/source/sidebar/tools/ColorControl.cxx

Modified: 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
 Wed Apr  3 11:36:15 2013
@@ -153,6 +153,7 @@ void AlignmentPropertyPanel::Initialize(
        mpMtrAngle->InsertValue(225, FUNIT_CUSTOM);
        mpMtrAngle->InsertValue(270, FUNIT_CUSTOM);
        mpMtrAngle->InsertValue(315, FUNIT_CUSTOM);
+    mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
 
     mpTBHorizontal->SetAccessibleRelationLabeledBy(mpTBHorizontal.get());
        mpTBVertical->SetAccessibleRelationLabeledBy(mpTBVertical.get());

Modified: 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
 Wed Apr  3 11:36:15 2013
@@ -103,6 +103,7 @@ void NumberFormatPropertyPanel::Initiali
        mpLbCategory->SetSelectHdl ( aLink );
        mpLbCategory->SelectEntryPos(0);
        mpLbCategory->SetAccessibleName(::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("Category")));             //wj acc
+    mpLbCategory->SetDropDownLineCount(mpLbCategory->GetEntryCount());
 
        mpTBCategory->SetItemImage(ID_NUMBER, maImgNumber);
        mpTBCategory->SetItemImage(ID_PERCENT, maImgPercent);

Modified: 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.src
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.src?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.src
 (original)
+++ 
openoffice/branches/sidebar/main/sc/source/ui/sidebar/NumberFormatPropertyPanel.src
 Wed Apr  3 11:36:15 2013
@@ -52,15 +52,15 @@ Control RID_PROPERTYPANEL_SC_NUMBERFORMA
                StringList [ en-US ] =
                {
                        < "General" ; Default ; > ;
-                       < "Number" ; Default ; > ;
-                       < "Percent" ; Default ; > ;
-                       < "Currency" ; Default ; > ;
-                       < "Date" ; Default ; > ;
-                       < "Time" ; Default ; > ;
-                       < "Scientific" ; Default ; > ;
-                       < "Fraction" ; Default ; > ;
-                       < "Boolean Value" ; Default ; > ;
-                       < "Text" ; Default ; > ;
+                       < "Number" ;> ;
+                       < "Percent" ;> ;
+                       < "Currency" ;> ;
+                       < "Date" ;> ;
+                       < "Time" ;> ;
+                       < "Scientific" ;> ;
+                       < "Fraction" ;> ;
+                       < "Boolean Value" ;> ;
+                       < "Text" ;> ;
                };
        };
        ToolBox TBX_CATEGORY

Modified: openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ColorControl.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ColorControl.hxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ColorControl.hxx 
(original)
+++ openoffice/branches/sidebar/main/svx/inc/svx/sidebar/ColorControl.hxx Wed 
Apr  3 11:36:15 2013
@@ -42,8 +42,9 @@ public:
     /** Create a new ColorControl object.
         @param rControlResId
             The resource id for the whole color control.
-        @param rColorGetter
-            A functor for setting the (default/preselected) color.
+        @param rNoColorGetter
+            A functor for getting the color which will be returned when the
+            WB_NONEFIELD is used and got selected
         @param rColorSetter
             A functor for setting the color that is selected by the
             user.
@@ -59,7 +60,7 @@ public:
         SfxBindings* pBindings,
         const ResId& rControlResId,
         const ResId& rValueSetResId,
-        const ::boost::function<Color(void)>& rColorGetter,
+        const ::boost::function<Color(void)>& rNoColorGetter,
         const ::boost::function<void(String&,Color)>& rColorSetter,
         FloatingWindow* pFloatingWindow,
         const ResId* pNoColorStringResId);
@@ -75,7 +76,7 @@ private:      
        ValueSet maVSColor;
     FloatingWindow* mpFloatingWindow;
     const String msNoColorString;
-    ::boost::function<Color(void)> maColorGetter;
+    ::boost::function<Color(void)> maNoColorGetter;
     ::boost::function<void(String&,Color)> maColorSetter;
 
        void FillColors (void);

Modified: 
openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx 
(original)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/line/LinePropertyPanel.cxx 
Wed Apr  3 11:36:15 2013
@@ -357,9 +357,11 @@ void LinePropertyPanel::Initialize()
        aLink = LINK( this, LinePropertyPanel, ChangeStartHdl );
        mpLBStart->SetSelectHdl( aLink );
        mpLBStart->SetAccessibleName(::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("Beginning Style"))); //wj acc
+    mpLBStart->SetDropDownLineCount(std::min(sal_uInt16(20), 
mpLBStart->GetEntryCount()));
        aLink = LINK( this, LinePropertyPanel, ChangeEndHdl );
        mpLBEnd->SetSelectHdl( aLink );
        mpLBEnd->SetAccessibleName(::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("Ending Style")));      //wj acc
+    mpLBEnd->SetDropDownLineCount(std::min(sal_uInt16(20), 
mpLBEnd->GetEntryCount()));
 
        aLink = LINK(this, LinePropertyPanel, ChangeTransparentHdl);
        mpMFTransparent->SetModifyHdl(aLink);

Modified: 
openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
 Wed Apr  3 11:36:15 2013
@@ -198,7 +198,7 @@ void PosSizePropertyPanel::Initialize()
        mpMtrAngle->InsertValue(22500, FUNIT_CUSTOM);
        mpMtrAngle->InsertValue(27000, FUNIT_CUSTOM);
        mpMtrAngle->InsertValue(31500, FUNIT_CUSTOM);
-    mpMtrAngle->SetDropDownLineCount(8);
+    mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
 
     SfxViewShell* pCurSh = SfxViewShell::Current();
        if ( pCurSh )

Modified: 
openoffice/branches/sidebar/main/svx/source/sidebar/tools/ColorControl.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/tools/ColorControl.cxx?rev=1463926&r1=1463925&r2=1463926&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/tools/ColorControl.cxx 
(original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/tools/ColorControl.cxx 
Wed Apr  3 11:36:15 2013
@@ -93,7 +93,7 @@ ColorControl::ColorControl (
     SfxBindings* pBindings,
     const ResId& rControlResId,
     const ResId& rValueSetResId,
-    const ::boost::function<Color(void)>& rColorGetter,
+    const ::boost::function<Color(void)>& rNoColorGetter,
     const ::boost::function<void(String&,Color)>& rColorSetter,
     FloatingWindow* pFloatingWindow,
     const ResId* pNoColorStringResId) // const sal_uInt32 nNoColorStringResId)
@@ -105,7 +105,7 @@ ColorControl::ColorControl (
           pNoColorStringResId
               ? String(*pNoColorStringResId)
               : String()),
-      maColorGetter(rColorGetter),
+      maNoColorGetter(rNoColorGetter),
       maColorSetter(rColorSetter)
 {
        FreeResource();
@@ -206,13 +206,13 @@ IMPL_LINK(ColorControl, VSSelectHdl, voi
     {
         sal_uInt16 iPos = maVSColor.GetSelectItemId();
         Color aColor = maVSColor.GetItemColor( iPos );
-        
         String aTmpStr = maVSColor.GetItemText( iPos );
-        if (aColor.GetColor() == 0
-            && aTmpStr.Equals(String::CreateFromAscii("")))
+
+        // react when the WB_NONEFIELD created entry is selected
+        if (aColor.GetColor() == 0 && 
aTmpStr.Equals(String::CreateFromAscii("")))
         {
-            if (maColorGetter)
-                aColor = maColorGetter();
+            if (maNoColorGetter)
+                aColor = maNoColorGetter();
         }
         if (maColorSetter)
             maColorSetter(aTmpStr, aColor);


Reply via email to