[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - 5 commits - oox/source writerfilter/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Wed Jun 19 04:58:48 PDT 2013


 oox/source/vml/vmlshape.cxx                              |   11 ++++++--
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   20 ++++++++++++---
 writerfilter/source/dmapper/GraphicImport.cxx            |    3 --
 writerfilter/source/dmapper/PropertyMap.cxx              |    4 +--
 writerfilter/source/dmapper/StyleSheetTable.cxx          |    3 --
 writerfilter/source/dmapper/WrapPolygonHandler.cxx       |    8 +++---
 writerfilter/source/dmapper/WrapPolygonHandler.hxx       |    2 -
 7 files changed, 35 insertions(+), 16 deletions(-)

New commits:
commit ebd25b53f8416340391429921232a8b0fbb1f331
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed May 22 11:34:01 2013 +0200

    n#816593: Floating table width import fix: adjust the frame width
    
    (cherry picked from commit 9f4c8a8bca06b4c2a916a51909367b453fc41a8b)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/data/table_width.docx
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: I8212bc5981418f6cbd514bf5002e6a5dbdf53152
    (cherry picked from commit 33e392e7d4fbfc61480751311e7187a5730acc78)

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a3bdb71..3b5aa4c 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -779,9 +779,23 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel)
         if (xTable.is() && xStart.is() && xEnd.is())
         {
             uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY);
-            aFrameProperties.realloc(aFrameProperties.getLength() + 1);
-            aFrameProperties[aFrameProperties.getLength() - 1].Name = "Width";
-            aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("Width");
+            sal_Bool bIsRelative = sal_False;
+            xTableProperties->getPropertyValue("IsWidthRelative") >>= bIsRelative;
+            if (!bIsRelative)
+            {
+                aFrameProperties.realloc(aFrameProperties.getLength() + 1);
+                aFrameProperties[aFrameProperties.getLength() - 1].Name = "Width";
+                aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("Width");
+            }
+            else
+            {
+                aFrameProperties.realloc(aFrameProperties.getLength() + 1);
+                aFrameProperties[aFrameProperties.getLength() - 1].Name = "FrameWidthPercent";
+                aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("RelativeWidth");
+
+                // Applying the relative width to the frame, needs to have the table width to be 100% of the frame width
+                xTableProperties->setPropertyValue("RelativeWidth", uno::makeAny(sal_Int16(100)));
+            }
 
             // A non-zero left margin would move the table out of the frame, move the frame itself instead.
             xTableProperties->setPropertyValue("LeftMargin", uno::makeAny(sal_Int32(0)));
commit 666482ebbd1f459bf8ace91c9374590b1bfaa978
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jun 12 16:01:00 2013 +0200

    n#779642: 0 width or height in //v:shape[@style] produces weird results
    
    (cherry picked from commit b7144acb2bfa369fb89146d060dbd8ddd547f4c1)
    
    Conflicts:
    	oox/source/vml/vmlshape.cxx
    
    Change-Id: I37ba59dd54ac692f234f3228e442799c5a5f450b
    (cherry picked from commit 3ad1d411f658b0c2bc8e318aebb999ab75675327)

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 32ab756..bf421863 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -192,11 +192,18 @@ awt::Rectangle ShapeType::getAbsRectangle() const
 
 awt::Rectangle ShapeType::getRelRectangle() const
 {
+    sal_Int32 nWidth = maTypeModel.maWidth.toInt32();
+    if ( nWidth == 0 )
+        nWidth = 1;
+
+    sal_Int32 nHeight = maTypeModel.maHeight.toInt32();
+    if ( nHeight == 0 )
+        nHeight = 1;
+
     return awt::Rectangle(
         maTypeModel.maLeft.toInt32(),
         maTypeModel.maTop.toInt32(),
-        maTypeModel.maWidth.toInt32(),
-        maTypeModel.maHeight.toInt32() );
+        nWidth, nHeight );
 }
 
 // ============================================================================
commit f2100b09abdf7893104f23f33cf77cc0848b55cb
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Wed Jun 19 10:42:47 2013 +0200

    n#820800: docx import of wrap polyon was based on dest size of picture
    
    ... instead of the original size of it.
    
    Change-Id: Ib251206dd092a7c47343caf50bd05a3dfec1af09
    (cherry picked from commit ae6981601b0e9175efaf9849b1279290ea3380f6)

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index e64beca..20dd71a 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -1495,8 +1495,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
                 if( aGraphicSize.Width && aGraphicSize.Height &&
                     m_pImpl->mpWrapPolygon.get() != NULL)
                 {
-                    awt::Size aDstSize(m_pImpl->getXSize(), m_pImpl->getYSize());
-                    WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize, aDstSize);
+                    WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize);
                     aContourPolyPolygon <<= pCorrected->getPointSequenceSequence();
                 }
 
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
index 8d6682a..73f24b4 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.cxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
@@ -113,7 +113,7 @@ WrapPolygon::Pointer_t WrapPolygon::scale(const Fraction & rFractionX, const Fra
     return pResult;
 }
 
-WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize)
+WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize)
 {
     WrapPolygon::Pointer_t pResult;
 
@@ -128,9 +128,9 @@ WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSr
     Fraction aScaleY(nWrap100Percent, Fraction(nWrap100Percent) - aMove);
     pResult = pResult->scale(aScaleX, aScaleY);
 
-    Fraction aScaleDestX(rDstSize.Width, nWrap100Percent);
-    Fraction aScaleDestY(rDstSize.Height, nWrap100Percent);
-    pResult = pResult->scale(aScaleDestX, aScaleDestY);
+    Fraction aScaleSrcX(rSrcSize.Width, nWrap100Percent);
+    Fraction aScaleSrcY(rSrcSize.Height, nWrap100Percent);
+    pResult = pResult->scale(aScaleSrcX, aScaleSrcY);
 
     return pResult;
 }
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.hxx b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
index 8e51b73..5783f0d 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.hxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
@@ -64,7 +64,7 @@ public:
 
     WrapPolygon::Pointer_t move(const awt::Point & rMove);
     WrapPolygon::Pointer_t scale(const Fraction & rFractionX, const Fraction & rFractionY);
-    WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize);
+    WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize);
     drawing::PointSequenceSequence getPointSequenceSequence() const;
 };
 
commit 5c73a72418251e40c44b7e1634011aea6f8db376
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Jun 18 11:01:20 2013 +0200

    n#820836: dmapper, fixed typos in first page style creation
    
    Change-Id: I80031cab7c0304311bd5acbb3a2ead48e15594bb
    (cherry picked from commit ab653ae64d782e5bd54bd169ab11755dab310553)

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 5f34542..cec4dce 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1017,9 +1017,9 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
 
             sal_Int32 nPaperBin = m_nFirstPaperBin >= 0 ? m_nFirstPaperBin : m_nPaperBin >= 0 ? m_nPaperBin : 0;
             if( nPaperBin )
-                xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) );
+                xFirstPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) );
             if( xColumns.is() )
-                xFollowPageStyle->setPropertyValue(
+                xFirstPageStyle->setPropertyValue(
                     rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns ));
         }
 
commit 8405e34a4f2b2c59469db4663219531b56cb6a37
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Mon Jun 17 13:42:34 2013 +0200

    n#820504: default color hidden by Default style in writerfilter
    
    Setting the font color of the default paragraph style to Auto makes the
    color set in the Writer defaults (from rPrDefault) ignored.
    
    Change-Id: I1dcd92bcd0774f5229785373242899a492ab7b7c
    (cherry picked from commit d7acb5ba0924f848f1ae96eceab50a0169d18445)

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index c35c3e8..8ddbeec 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -780,8 +780,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
                         pEntry->pProperties->Insert(PROP_PARA_ORPHANS, true, aTwo, false);
     //                  Left-to-right direction if not already set
                         pEntry->pProperties->Insert(PROP_WRITING_MODE, true, uno::makeAny( sal_Int16(text::WritingMode_LR_TB) ), false);
-    //                  font color COL_AUTO if not already set
-                        pEntry->pProperties->Insert(PROP_CHAR_COLOR, true, uno::makeAny( sal_Int32(0xffffffff) ), false);
+                        // Don't set font color to Auto if not already set: this could hide the default font color setting
                     }
 
                     uno::Sequence< beans::PropertyValue > aPropValues = pEntry->pProperties->GetPropertyValues();


More information about the Libreoffice-commits mailing list