[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 10 commits - oox/source sc/source sd/qa svx/source sw/qa writerfilter/source

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Fri Oct 3 01:27:32 PDT 2014


 oox/source/drawingml/color.cxx                           |   30 +++++---
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx      |   10 ++
 oox/source/drawingml/table/tablecell.cxx                 |   55 +++++++++------
 sc/source/ui/dbgui/filtdlg.cxx                           |    5 +
 sc/source/ui/dbgui/validate.cxx                          |   15 +++-
 sc/source/ui/view/cellsh2.cxx                            |    2 
 sd/qa/unit/data/pptx/bnc584721_4.pptx                    |binary
 sd/qa/unit/import-tests.cxx                              |   53 ++++++++++++++
 svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx |    2 
 sw/qa/core/data/ooxml/pass/fdo73608-1.docx               |binary
 sw/qa/core/data/ooxml/pass/fdo73608-2.docx               |binary
 sw/qa/core/data/ooxml/pass/fdo79129.docx                 |binary
 sw/qa/core/data/ooxml/pass/fdo79131.docx                 |binary
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   16 ++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |    2 
 15 files changed, 149 insertions(+), 41 deletions(-)

New commits:
commit ab218d72e9c044541f855f6e39cd9a7b0346fa8f
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Thu Oct 2 17:21:36 2014 +0200

    shared_ptr is too smart to accept NULL
    
    Change-Id: Id1bc223ffe2a8811219cdc47d145cd139199281a
    Reviewed-on: https://gerrit.libreoffice.org/11767
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f564407..cdb1198 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3088,7 +3088,7 @@ void DomainMapper_Impl::CloseFieldCommand()
     dmapper_logger->element("closeFieldCommand");
 #endif
 
-    FieldContextPtr pContext = m_aFieldStack.empty() ? NULL : m_aFieldStack.top();
+    FieldContextPtr pContext = m_aFieldStack.empty() ? boost::shared_ptr<FieldContext>() : m_aFieldStack.top();
     OSL_ENSURE( pContext.get(), "no field context available");
     if( pContext.get() )
     {
commit 2374173a331db79425ffe28ed0765b16817e5d6b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Sep 27 20:38:24 2014 +0100

    Resolves: fdo#79130 Crash in DomainMapper_Impl::CloseFieldCommand
    
    Change-Id: Ia59e0c79ec7f2066891b78657559f41eaeb80a09
    (cherry picked from commit a392a1deb0bb55f39f0232f9b3df8ad9ac9062af)
    Reviewed-on: https://gerrit.libreoffice.org/11666
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 37152f6..f564407 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3088,7 +3088,7 @@ void DomainMapper_Impl::CloseFieldCommand()
     dmapper_logger->element("closeFieldCommand");
 #endif
 
-    FieldContextPtr pContext = m_aFieldStack.top();
+    FieldContextPtr pContext = m_aFieldStack.empty() ? NULL : m_aFieldStack.top();
     OSL_ENSURE( pContext.get(), "no field context available");
     if( pContext.get() )
     {
commit 142527fff381c3269ca05e99b9fb8a6fb7ab1b6c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Sep 28 16:47:13 2014 +0100

    Related: fdo#73608 don't crash on missing table styles
    
    (cherry picked from commit 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f)
    
    Conflicts:
    	writerfilter/source/dmapper/DomainMapperTableHandler.cxx
    
    Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540
    
    Resolves: fdo#73608 bail out on loop in style sheet hierarchy
    
    Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb
    (cherry picked from commit be18133e84120625734a09380594ee89b23c4322)
    Reviewed-on: https://gerrit.libreoffice.org/11680
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-1.docx b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx
new file mode 100644
index 0000000..d3cc84a
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx differ
diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-2.docx b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx
new file mode 100644
index 0000000..f558878
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx differ
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 7b8d9cd..b4002d7 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -116,9 +116,17 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
 PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
 {
     PropertyMapPtr pRet;
+
+    if (!pStyleSheet)
+        return pRet;
+
     if(!pStyleSheet->sBaseStyleIdentifier.isEmpty())
     {
         const StyleSheetEntryPtr pParentStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( pStyleSheet->sBaseStyleIdentifier );
+        //a loop in the style hierarchy, bail out
+        if (pParentStyleSheet == pStyleSheet)
+            return pRet;
+
         pRet = lcl_SearchParentStyleSheetAndMergeProperties( pParentStyleSheet, pStyleSheetTable );
     }
     else
@@ -126,7 +134,10 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
         pRet.reset( new PropertyMap );
     }
 
-    pRet->InsertProps(pStyleSheet->pProperties);
+    if (pRet)
+    {
+        pRet->InsertProps(pStyleSheet->pProperties);
+    }
 
     return pRet;
 }
@@ -291,6 +302,9 @@ namespace
 
 bool lcl_extractTableBorderProperty(PropertyMapPtr pTableProperties, const PropertyIds nId, TableInfo& rInfo, table::BorderLine2& rLine)
 {
+    if (!pTableProperties)
+        return false;
+
     PropertyMap::iterator aTblBorderIter = pTableProperties->find(nId);
     if( aTblBorderIter != pTableProperties->end() )
     {
commit 0e9d68707f0e76054375334fc28b6abacad77cb3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 29 20:38:18 2014 +0100

    Resolves: fdo#79131 crash in EnhancedCustomShapeTypeNames::Get
    
    Change-Id: Ib21a4a1574119120f09d4ecac73b93a0f2f6739f
    (cherry picked from commit 65277f994ae25d930c15aebba0ed19f8de0abba1)
    Reviewed-on: https://gerrit.libreoffice.org/11704
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
index 8e79662..6eca6e9 100644
--- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
@@ -300,7 +300,7 @@ MSO_SPT EnhancedCustomShapeTypeNames::Get( const OUString& rShapeType )
 
 OUString EnhancedCustomShapeTypeNames::Get( const MSO_SPT eShapeType )
 {
-    return eShapeType <= mso_sptTextBox
+    return (eShapeType <= mso_sptTextBox && eShapeType >= mso_sptMin)
         ? OUString::createFromAscii( pNameTypeTableArray[ eShapeType ].pS )
         : OUString();
 }
diff --git a/sw/qa/core/data/ooxml/pass/fdo79131.docx b/sw/qa/core/data/ooxml/pass/fdo79131.docx
new file mode 100644
index 0000000..5f10d9c
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo79131.docx differ
commit b5ddcd4b3dc7395dd6f8bbf86c85465ccb0013ce
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Tue Sep 30 19:55:50 2014 +0200

    bnc#584721: invisible text because of wrong color (white)
    
    Color::getColor() method uses some caching mechanism which
    works wrong when the result depend on one of the input parameters.
    So avoid caching in these cases.
    
    (cherry picked from commit cfe658c289de030dc3a8fecd3bac0a0004a18061)
    
    Conflicts:
    	sd/qa/unit/import-tests.cxx
    
    Change-Id: Ifa9221e21e685715454de86d5cec09ff6c266307
    Reviewed-on: https://gerrit.libreoffice.org/11723
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 52d5465..ec084cc 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -342,13 +342,10 @@ void Color::clearTransparence()
 
 sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr ) const
 {
-    /*  Special handling for theme style list placeholder colors (state
-        COLOR_PH), Color::getColor() may be called with different placeholder
-        colors in the nPhClr parameter. Therefore, the resolved color will not
-        be stored in this object, thus the state COLOR_FINAL will not be
-        reached and the transformation container will not be cleared, but the
-        original COLOR_PH state will be restored instead. */
-    bool bIsPh = false;
+    const sal_Int32 nTempC1 = mnC1;
+    const sal_Int32 nTempC2 = mnC2;
+    const sal_Int32 nTempC3 = mnC3;
+    const ColorMode eTempMode = meMode;
 
     switch( meMode )
     {
@@ -361,7 +358,7 @@ sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr
         case COLOR_SCHEME:  setResolvedRgb( rGraphicHelper.getSchemeColor( mnC1 ) );        break;
         case COLOR_PALETTE: setResolvedRgb( rGraphicHelper.getPaletteColor( mnC1 ) );       break;
         case COLOR_SYSTEM:  setResolvedRgb( rGraphicHelper.getSystemColor( mnC1, mnC2 ) );  break;
-        case COLOR_PH:      setResolvedRgb( nPhClr ); bIsPh = true;                         break;
+        case COLOR_PH:      setResolvedRgb( nPhClr );                                       break;
 
         case COLOR_FINAL:   return mnC1;
     }
@@ -497,10 +494,23 @@ sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr
         mnC1 = API_RGB_TRANSPARENT;
     }
 
-    meMode = bIsPh ? COLOR_PH : COLOR_FINAL;
+    sal_Int32 nRet = mnC1;
+    // Restore the original values when the color depends on one of the input
+    // parameters (rGraphicHelper or nPhClr)
+    if( eTempMode >= COLOR_SCHEME && eTempMode <= COLOR_PH )
+    {
+        mnC1 = nTempC1;
+        mnC2 = nTempC2;
+        mnC3 = nTempC3;
+        meMode = eTempMode;
+    }
+    else
+    {
+        meMode = COLOR_FINAL;
+    }
     if( meMode == COLOR_FINAL )
         maTransforms.clear();
-    return mnC1;
+    return nRet;
 }
 
 bool Color::hasTransparency() const
diff --git a/sd/qa/unit/data/pptx/bnc584721_4.pptx b/sd/qa/unit/data/pptx/bnc584721_4.pptx
new file mode 100644
index 0000000..102ee0b
Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc584721_4.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index a31a11e..ffaa259 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -68,6 +68,7 @@ public:
     void testBnc862510_5();
     void testBnc480256();
     void testCreationDate();
+    void testBnc584721_4();
 
     CPPUNIT_TEST_SUITE(SdFiltersTest);
     CPPUNIT_TEST(testDocumentLayout);
@@ -86,6 +87,7 @@ public:
     CPPUNIT_TEST(testBnc862510_5);
     CPPUNIT_TEST(testBnc480256);
     CPPUNIT_TEST(testCreationDate);
+    CPPUNIT_TEST(testBnc584721_4);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -691,6 +693,45 @@ void SdFiltersTest::testBnc480256()
     xDocShRef->DoClose();
 }
 
+void SdFiltersTest::testBnc584721_4()
+{
+    // Black text was imported as white because of wrong caching mechanism
+
+    ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc584721_4.pptx"));
+
+    uno::Reference< drawing::XDrawPagesSupplier > xDoc(
+        xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
+
+    uno::Reference< drawing::XDrawPage > xPage(
+        xDoc->getDrawPages()->getByIndex(1), uno::UNO_QUERY_THROW );
+
+    uno::Reference< beans::XPropertySet > xShape(
+        xPage->getByIndex(1), uno::UNO_QUERY );
+    CPPUNIT_ASSERT_MESSAGE( "no text shape", xShape.is() );
+
+    // Get first paragraph of the text
+    uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+    CPPUNIT_ASSERT_MESSAGE( "no text shape", xText.is() );
+    uno::Reference<container::XEnumerationAccess> paraEnumAccess;
+    paraEnumAccess.set(xText, uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+    uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
+                uno::UNO_QUERY_THROW);
+
+    // Get first run of the paragraph
+    uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+    uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+    uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
+    sal_Int32 nCharColor;
+    xPropSet->getPropertyValue( "CharColor" ) >>= nCharColor;
+
+    // Color should be black
+    CPPUNIT_ASSERT_EQUAL( sal_Int32(COL_BLACK), nCharColor );
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit e530e0a2fb1cd4d89a21e2d3dc7db2f2f53aa97a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 30 10:43:37 2014 +0100

    Resolves: fdo#79129 Crash in oox::drawingml::LayoutNode::setupShape
    
    Change-Id: I0bafd2c43d29806eea0ff0cb165e67aece53488f
    (cherry picked from commit c84ce79132c674b4c2d31da8997ed77671323dfe)
    Reviewed-on: https://gerrit.libreoffice.org/11727
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 2953660..2a196d5 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -400,7 +400,15 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const Diagram& rDgm, sal_uI
             const DiagramData::StringMap::value_type::second_type::const_iterator aVecEnd=aNodeName->second.end();
             while( aVecIter != aVecEnd )
             {
-                DiagramData::PointNameMap::const_iterator aDataNode2=rDgm.getData()->getPointNameMap().find(aVecIter->first);
+                DiagramData::PointNameMap& rMap = rDgm.getData()->getPointNameMap();
+                DiagramData::PointNameMap::const_iterator aDataNode2 = rMap.find(aVecIter->first);
+                if (aDataNode2 == rMap.end())
+                {
+                    //busted, skip it
+                    ++aVecIter;
+                    continue;
+                }
+
                 if( aVecIter->second == 0 )
                 {
                     // grab shape attr from topmost element(s)
diff --git a/sw/qa/core/data/ooxml/pass/fdo79129.docx b/sw/qa/core/data/ooxml/pass/fdo79129.docx
new file mode 100644
index 0000000..46ff0f5
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo79129.docx differ
commit f8ad613b1ed8ff6889027247be008a39198e17f8
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sat Sep 27 07:59:04 2014 +0200

    fdo#53920 Switch back tab at RefButton closure time
    
    Bug occurs because visible tab is not the initial tab. So, instead of
    switching back to initial tab at dialog closure time (removed from
    cellsh2.cxx), this commit proposes that switching back to initial tab
    is operate when expanding the RefButton shrink dialog.
    
    Reviewed-on: https://gerrit.libreoffice.org/11660
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>
    (cherry picked from commit 31432c4469e7e0d05516143533d6b5e0b411dda3)
    
    Change-Id: I3cf7ed14054fa69881d4ecbc55c48dfbfc4356aa

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 84a62f88..055e81c 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -145,11 +145,21 @@ void            ScTPValidationValue::RefInputDonePostHdl()
     }
 
     if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
+    {
         pValidationDlg->get_refinput_shrink_parent()->Hide();
+        ScViewData* pViewData = pValidationDlg->GetTabViewShell()->GetViewData();
+        SCTAB nCurTab = pViewData->GetTabNo();
+        SCTAB nRefTab = pViewData->GetRefTabNo();
+        // If RefInput switched to a different sheet from the data sheet,
+        // switch back: fdo#53920
+        if ( nCurTab != nRefTab )
+        {
+             pViewData->GetViewShell()->SetTabNo( nRefTab );
+        }
+    }
 
     if( m_pRefEdit && !m_pRefEdit->HasFocus() )
         m_pRefEdit->GrabFocus();
-
 }
 
 sal_Bool ScValidationDlg::Close()
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index a93761c..2e95cf1 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -852,8 +852,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     OSL_ENSURE(pDlg, "Dialog create fail!");
 
                     short nResult = pDlg->Execute();
-                    //When picking Cell Range, other Tab may be switched. Need restore the correct tab
-                    pTabViewShell->SetTabNo( nTab );
                     if ( nResult == RET_OK )
                     {
                         const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
commit ddf0770c57ce0ed699eaf9223f607f039a92931e
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Sep 22 11:59:14 2014 +0200

    bnc#897769: OOXML import: Import border lines using reference too.
    
    Do not ignore 'lnRef' element.
    
    Also fix typo to apply 'seCell' properties to the right cell (southeast).
    
    Change-Id: Ia45f7016f358b70e6db06a232c569335ce9d7051
    (cherry picked from commit 18898e13fda25fe6dc85318dd0711355c7b2cc26)

diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 583d7aa..baf49a6 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -84,15 +84,26 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
     aPropSet.setProperty( nPropId, aBorderLine );
 }
 
-void applyBorder( TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties )
+void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties )
 {
     std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() );
+    ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ];
     std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) );
     if ( ( aIter != rPartLineBorders.end() ) && aIter->second.get() )
         rLineProperties.assignUsed( *aIter->second );
+    else if (rLineStyleRef.mnThemedIdx != 0)
+    {
+        if (const Theme* pTheme = rFilterBase.getCurrentTheme())
+        {
+            rLineProperties.assignUsed( *pTheme->getLineStyle(rLineStyleRef.mnThemedIdx) );
+            sal_Int32 nPhClr = rLineStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() );
+            rLineProperties.maLineFill.maFillColor.setSrgbClr( nPhClr );
+        }
+    }
 }
 
-void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties,
+void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase,
+                          oox::drawingml::FillProperties& rFillProperties,
                           TextCharacterProperties& aTextCharProps,
                           oox::drawingml::LineProperties& rLeftBorder,
                           oox::drawingml::LineProperties& rRightBorder,
@@ -106,12 +117,12 @@ void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties,
     if ( rPartFillPropertiesPtr.get() )
         rFillProperties.assignUsed( *rPartFillPropertiesPtr );
 
-    applyBorder( rTableStylePart, XML_left, rLeftBorder );
-    applyBorder( rTableStylePart, XML_right, rRightBorder );
-    applyBorder( rTableStylePart, XML_top, rTopBorder );
-    applyBorder( rTableStylePart, XML_bottom, rBottomBorder );
-    applyBorder( rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
-    applyBorder( rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
+    applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
 
     aTextCharProps.maLatinFont = rTableStylePart.getLatinFont();
     aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
@@ -171,7 +182,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight;
     oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight;
 
-    applyTableStylePart( aFillProperties, aTextStyleProps,
+    applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
         aLinePropertiesLeft,
         aLinePropertiesRight,
         aLinePropertiesTop,
@@ -182,7 +193,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
 
     if ( rProperties.isFirstRow() && ( nRow == 0 ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -193,7 +204,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isLastRow() && ( nRow == nMaxRow ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -204,7 +215,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isFirstCol() && ( nColumn == 0 ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -215,7 +226,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -236,7 +247,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
                 nBand++;
             if ( nBand & 1 )
             {
-                applyTableStylePart( aFillProperties, aTextStyleProps,
+                applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -247,7 +258,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
             }
             else
             {
-                applyTableStylePart( aFillProperties, aTextStyleProps,
+                applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -260,7 +271,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == 0 ) && ( nColumn == 0 ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -271,7 +282,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -282,7 +293,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
     }
     if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -291,9 +302,9 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
             aLinePropertiesBottomLeftToTopRight,
             rTable.getNeCell() );
     }
-    if ( ( nRow == nMaxColumn ) && ( nColumn == nMaxColumn ) )
+    if ( ( nRow == nMaxRow ) && ( nColumn == nMaxColumn ) )
     {
-        applyTableStylePart( aFillProperties, aTextStyleProps,
+        applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
             aLinePropertiesLeft,
             aLinePropertiesRight,
             aLinePropertiesTop,
@@ -314,7 +325,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
                 nBand++;
             if ( nBand & 1 )
             {
-                applyTableStylePart( aFillProperties, aTextStyleProps,
+                applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
@@ -325,7 +336,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
             }
             else
             {
-                applyTableStylePart( aFillProperties, aTextStyleProps,
+                applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
                     aLinePropertiesLeft,
                     aLinePropertiesRight,
                     aLinePropertiesTop,
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index bac7109..a31a11e 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -44,6 +44,7 @@
 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
 #include <com/sun/star/chart2/data/XDataSequence.hpp>
 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 
 using namespace ::com::sun::star;
 
@@ -651,6 +652,7 @@ void SdFiltersTest::testBnc480256()
     uno::Reference< table::XCellRange > xTable;
     uno::Reference< beans::XPropertySet > xCell;
     sal_Int32 nColor;
+    table::BorderLine2 aBorderLine;
 
     pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
     CPPUNIT_ASSERT( pTableObj );
@@ -659,10 +661,14 @@ void SdFiltersTest::testBnc480256()
     xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillColor") >>= nColor;
     CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
+    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
 
     xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillColor") >>= nColor;
     CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
+    xCell->getPropertyValue("TopBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
 
     pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
     CPPUNIT_ASSERT( pTableObj );
@@ -671,11 +677,17 @@ void SdFiltersTest::testBnc480256()
     xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillColor") >>= nColor;
     CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
+    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
 
     xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
     xCell->getPropertyValue("FillColor") >>= nColor;
     CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
 
+    xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(0), aBorderLine.Color);
+
     xDocShRef->DoClose();
 }
 
commit 5fa0f22a656e66577e1a706e25ce1b821c920615
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Mon Sep 22 08:07:01 2014 +0200

    fdo#83848 Add GetAddressConvention to RefButton
    
    Reviewed-on: https://gerrit.libreoffice.org/11578
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>
    (cherry picked from commit 2c7595a911c3b0102162c2ad9cef4a84538b66f8)
    
    Change-Id: I20d633909d3c13bf49998a6cca054ab125b6c991

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 49e0bce..84a62f88 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -48,6 +48,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/childwin.hxx>
 #include "reffact.hxx"
+#include <document.hxx>
 
 // ============================================================================
 
@@ -88,7 +89,7 @@ void ScTPValidationValue::SetReferenceHdl( const ScRange&rRange , ScDocument* pD
 
     if ( m_pRefEdit )
     {
-        OUString aStr(rRange.Format(SCR_ABS_3D, pDoc));
+        OUString aStr(rRange.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
         m_pRefEdit->SetRefString( aStr );
     }
 }
commit ddb8caf05a965c4534cb1dd086c629a9e21bf252
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Wed Sep 24 02:11:28 2014 +0200

    fdo#65281 Empty/Not empty doesn't work in columns with date format
    
    "Empty" and "Not empty" predicates were unconditionally overriden
    in filter dialog for date format columns. Rectify it by preventing
    the overriding for these functions.
    
    Test Plan:
    
    * open calc document
    * define column with date format
    * put some data and let some columns empty
    * apply standard filter on date column with "Not empty" function
    * verify that rows with non empty columns still visible
    
    Change-Id: I2111c5a6b6350cab63173d42419069813d1137b6
    Reviewed-on: https://gerrit.libreoffice.org/11613
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>
    (cherry picked from commit 551ee32dfaaddd2aa48efebaefab0730474b656d)

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index c713e2a..bfa3adf 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -1112,15 +1112,18 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
         ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
         bool bDoThis = (pLbField->GetSelectEntryPos() != 0);
         rEntry.bDoQuery = bDoThis;
+        bool bByEmptyOrNotByEmpty = false;
 
         if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] )
         {
             if ( aStrEmpty.equals(aStrVal) )
             {
+                bByEmptyOrNotByEmpty = true;
                 rEntry.SetQueryByEmpty();
             }
             else if ( aStrNotEmpty.equals(aStrVal) )
             {
+                bByEmptyOrNotByEmpty = true;
                 rEntry.SetQueryByNonEmpty();
             }
             else
@@ -1140,7 +1143,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
 
             ScQueryOp eOp  = (ScQueryOp)pLbCond->GetSelectEntryPos();
             rEntry.eOp     = eOp;
-            if (maHasDates[nQE])
+            if (maHasDates[nQE] && !bByEmptyOrNotByEmpty)
                 rItem.meType = ScQueryEntry::ByDate;
         }
     }


More information about the Libreoffice-commits mailing list