[Libreoffice-commits] core.git: 4 commits - sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed May 13 17:06:20 PDT 2015


 sc/source/filter/excel/xeextlst.cxx       |    6 ++--
 sc/source/filter/inc/condformatbuffer.hxx |    9 +++---
 sc/source/filter/inc/xeextlst.hxx         |    2 +
 sc/source/filter/oox/condformatbuffer.cxx |   44 ++++++++++++++++++++++--------
 sc/source/ui/cctrl/checklistmenu.cxx      |    1 
 sc/source/ui/view/tabview3.cxx            |    6 ++--
 6 files changed, 48 insertions(+), 20 deletions(-)

New commits:
commit 9de1d53a2ce3ee7036b4688b373db7b2235af4d9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 14 01:57:12 2015 +0200

    VclPtr::reset does not delete the widget, tdf#91269
    
    Change-Id: I26f392dc32bc4eb6fa82a1446680725691126457

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index ecc9e2b..e7ffbed 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -609,7 +609,7 @@ void ScTabView::TestHintWindow()
         {
             //! Abfrage, ob an gleicher Stelle !!!!
 
-            mpInputHintWindow.reset();
+            mpInputHintWindow.disposeAndClear();
 
             ScSplitPos eWhich = aViewData.GetActivePart();
             ScGridWindow* pWin = pGridWin[eWhich];
@@ -638,7 +638,7 @@ void ScTabView::TestHintWindow()
             }
         }
         else
-            mpInputHintWindow.reset();
+            mpInputHintWindow.disposeAndClear();
 
         // list drop-down button
         if ( pData && pData->HasSelectionList() )
@@ -648,7 +648,7 @@ void ScTabView::TestHintWindow()
         }
     }
     else
-        mpInputHintWindow.reset();
+        mpInputHintWindow.disposeAndClear();
 
     for ( sal_uInt16 i=0; i<4; i++ )
         if ( pGridWin[i] && pGridWin[i]->IsVisible() )
commit ffd9e164af2895c19edeee90b35032d74e2eac96
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 14 01:39:14 2015 +0200

    fix dbgutil crash with autofilter dialog after VclPtr change
    
    Change-Id: Ic8f3079ddc7db8be349d4b322cc35a8f6aa38d9b

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 8dd50aa..8b98dfc 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -912,6 +912,7 @@ ScCheckListMenuWindow::~ScCheckListMenuWindow()
 
 void ScCheckListMenuWindow::dispose()
 {
+    maEdSearch.disposeAndClear();
     maChecks.disposeAndClear();
     maChkToggleAll.disposeAndClear();
     maBtnSelectSingle.disposeAndClear();
commit d8d078f4927ecc173e30c90d2859f756a601957a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 14 01:26:26 2015 +0200

    better databar negative color and axis color import
    
    Should finally handle themed colors and tints. There seem to be a few
    issue left that I need to understand.
    
    Change-Id: Icdd0a2d26519eb1c4171d6888913ba2c6944a443

diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index 18523d8..32042ce 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -224,15 +224,15 @@ struct ExCfRuleModel
     bool mbGradient;
     OUString maAxisPosition;
     // AxisColor
-    sal_uInt32 mnAxisColor;
+    ::Color mnAxisColor;
     // NegativeFillColor
-    sal_uInt32 mnNegativeColor;
+    ::Color mnNegativeColor;
     // Cfvo
     bool mbIsLower;
     OUString maColorScaleType;
 };
 
-class ExtCfRule
+class ExtCfRule : public WorksheetHelper
 {
     enum RuleType
     {
@@ -246,7 +246,8 @@ class ExtCfRule
     RuleType mnRuleType;
     ScDataBarFormatData* mpTarget;
 public:
-    ExtCfRule(ScDataBarFormatData* pTarget = NULL ) : mnRuleType( ExtCfRule::UNKNOWN ), mpTarget(pTarget) {}
+
+    ExtCfRule(ScDataBarFormatData* pTarget, WorksheetHelper& rParent);
     void finalizeImport();
     void importDataBar(  const AttributeList& rAttribs );
     void importNegativeFillColor(  const AttributeList& rAttribs );
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 08ea800..a5c42f3 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -171,9 +171,7 @@ namespace {
     return ::Color(ornA, ornR, ornG, ornB);
 }
 
-}
-
-void ColorScaleRule::importColor( const AttributeList& rAttribs )
+::Color importOOXColor(const AttributeList& rAttribs, ThemeBuffer& rThemeBuffer, GraphicHelper& rGraphicHelper)
 {
     sal_uInt32 nColor = 0;
     if( rAttribs.hasAttribute( XML_rgb ) )
@@ -181,7 +179,7 @@ void ColorScaleRule::importColor( const AttributeList& rAttribs )
     else if( rAttribs.hasAttribute( XML_theme ) )
     {
         sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 );
-        nColor = getTheme().getColorByIndex( nThemeIndex );
+        nColor = rThemeBuffer.getColorByIndex( nThemeIndex );
 
     }
 
@@ -192,12 +190,23 @@ void ColorScaleRule::importColor( const AttributeList& rAttribs )
         oox::drawingml::Color aDMColor;
         aDMColor.setSrgbClr(nColor);
         aDMColor.addExcelTintTransformation(nTint);
-        nColor = aDMColor.getColor(getBaseFilter().getGraphicHelper());
+        nColor = aDMColor.getColor(rGraphicHelper);
         aColor = ::Color(nColor);
     }
     else
         aColor = ARgbToARgbComponents( nColor );
 
+    return aColor;
+}
+
+}
+
+void ColorScaleRule::importColor( const AttributeList& rAttribs )
+{
+    ThemeBuffer& rThemeBuffer = getTheme();
+    GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+    ::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper);
+
     if(mnCol >= maColorScaleRuleEntries.size())
         maColorScaleRuleEntries.push_back(ColorScaleRuleModelEntry());
 
@@ -1075,7 +1084,7 @@ CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm
 
 ExtCfRuleRef CondFormatBuffer::createExtCfRule(ScDataBarFormatData* pTarget)
 {
-    ExtCfRuleRef extRule( new ExtCfRule( pTarget ) );
+    ExtCfRuleRef extRule( new ExtCfRule( pTarget, *this ) );
     maCfRules.push_back( extRule );
     return extRule;
 }
@@ -1124,6 +1133,13 @@ CondFormatRef CondFormatBuffer::createCondFormat()
     return xCondFmt;
 }
 
+ExtCfRule::ExtCfRule(ScDataBarFormatData* pTarget, WorksheetHelper& rParent):
+    WorksheetHelper(rParent),
+    mnRuleType( ExtCfRule::UNKNOWN ),
+    mpTarget(pTarget)
+{
+}
+
 void ExtCfRule::finalizeImport()
 {
     switch ( mnRuleType )
@@ -1143,13 +1159,13 @@ void ExtCfRule::finalizeImport()
         case AXISCOLOR:
         {
             ScDataBarFormatData* pDataBar = mpTarget;
-            pDataBar->maAxisColor = ARgbToARgbComponents(maModel.mnAxisColor);
+            pDataBar->maAxisColor = maModel.mnAxisColor;
             break;
         }
         case NEGATIVEFILLCOLOR:
         {
             ScDataBarFormatData* pDataBar = mpTarget;
-            pDataBar->mpNegativeColor.reset( new ::Color( ARgbToARgbComponents(maModel.mnNegativeColor) ) );
+            pDataBar->mpNegativeColor.reset( new ::Color(maModel.mnNegativeColor) );
             pDataBar->mbNeg = true;
             break;
         }
@@ -1193,14 +1209,20 @@ void ExtCfRule::importDataBar( const AttributeList& rAttribs )
 
 void ExtCfRule::importNegativeFillColor( const AttributeList& rAttribs )
 {
-     mnRuleType = NEGATIVEFILLCOLOR;
-     maModel.mnNegativeColor = rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT );
+    mnRuleType = NEGATIVEFILLCOLOR;
+    ThemeBuffer& rThemeBuffer = getTheme();
+    GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+    ::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper);
+    maModel.mnNegativeColor = aColor;
 }
 
 void ExtCfRule::importAxisColor( const AttributeList& rAttribs )
 {
     mnRuleType = AXISCOLOR;
-    maModel.mnAxisColor = rAttribs.getUnsignedHex( XML_rgb, UNSIGNED_RGB_TRANSPARENT );
+    ThemeBuffer& rThemeBuffer = getTheme();
+    GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+    ::Color aColor = importOOXColor(rAttribs, rThemeBuffer, rGraphicHelper);
+    maModel.mnAxisColor = aColor;
 }
 
 void ExtCfRule::importCfvo( const AttributeList& rAttribs )
commit be62a97a96734e40576784bb69b020ec82a195fc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 14 01:25:40 2015 +0200

    correct export for min and max databar length
    
    Forgot the extLst entry during my earlier work. Now they are both in
    sync again.
    
    Change-Id: Ie97276fde2b9d956ad4a3e93072a6d6627c5b0bf

diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index c621c24..885e1fd 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -123,6 +123,8 @@ XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarForm
 
     meAxisPosition = rFormatData.meAxisPosition;
     mbGradient = rFormatData.mbGradient;
+    mnMinLength = rFormatData.mnMinLength;
+    mnMaxLength = rFormatData.mnMaxLength;
 }
 
 namespace {
@@ -147,8 +149,8 @@ void XclExpExtDataBar::SaveXml( XclExpXmlStream& rStrm )
 {
     sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
     rWorksheet->startElementNS( XML_x14, XML_dataBar,
-                                XML_minLength, OString::number(0).getStr(),
-                                XML_maxLength, OString::number(100).getStr(),
+                                XML_minLength, OString::number(mnMinLength).getStr(),
+                                XML_maxLength, OString::number(mnMaxLength).getStr(),
                                 XML_axisPosition, getAxisPosition(meAxisPosition),
                                 XML_gradient, XclXmlUtils::ToPsz(mbGradient),
                                 FSEND );
diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx
index d65c9a7..e92afd5 100644
--- a/sc/source/filter/inc/xeextlst.hxx
+++ b/sc/source/filter/inc/xeextlst.hxx
@@ -78,6 +78,8 @@ public:
 private:
     databar::ScAxisPosition meAxisPosition;
     bool mbGradient;
+    double mnMinLength;
+    double mnMaxLength;
 
     std::unique_ptr<XclExpExtCfvo> mpLowerLimit;
     std::unique_ptr<XclExpExtCfvo> mpUpperLimit;


More information about the Libreoffice-commits mailing list