[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2015-04-17 Thread Caolán McNamara
 oox/source/export/chartexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b748d80a408e822c367e9b87fe2c7f50322c2219
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Apr 15 10:30:34 2015 +0100

fix crash on export of fdo60365-2.ods to xlsx

Change-Id: I1a281b096e4d1831bcf67ca03180afff043fbcfd
(cherry picked from commit 135907f2061550624ee1859745d94eee01849070)
Reviewed-on: https://gerrit.libreoffice.org/15321
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 0929096..cdcd680 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1941,7 +1941,7 @@ void ChartExport::exportSeriesCategory( const Reference 
chart2::data::XDataSequ
 pFS-startElement( FSNS( XML_c, XML_cat ),
 FSEND );
 
-OUString aCellRange =  xValueSeq-getSourceRangeRepresentation();
+OUString aCellRange = xValueSeq.is() ? 
xValueSeq-getSourceRangeRepresentation() : OUString();
 aCellRange = parseFormula( aCellRange );
 // TODO: need to handle XML_multiLvlStrRef according to aCellRange
 pFS-startElement( FSNS( XML_c, XML_strRef ),
@@ -1984,7 +1984,7 @@ void ChartExport::exportSeriesValues( const Reference 
chart2::data::XDataSequen
 pFS-startElement( FSNS( XML_c, nValueType ),
 FSEND );
 
-OUString aCellRange =  xValueSeq-getSourceRangeRepresentation();
+OUString aCellRange = xValueSeq.is() ? 
xValueSeq-getSourceRangeRepresentation() : OUString();
 aCellRange = parseFormula( aCellRange );
 // TODO: need to handle XML_multiLvlStrRef according to aCellRange
 pFS-startElement( FSNS( XML_c, XML_numRef ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sw/qa

2015-03-31 Thread Gary Houston
 oox/source/drawingml/shape.cxx |5 +++-
 oox/source/drawingml/textbodypropertiescontext.cxx |   11 +
 oox/source/drawingml/transform2dcontext.cxx|2 -
 sw/qa/extras/ooxmlimport/data/fdo87488.docx|binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   25 +++--
 5 files changed, 35 insertions(+), 8 deletions(-)

New commits:
commit 89032c4b7344139b7e3608d09e8c63b3eafd534b
Author: Gary Houston ghous...@arglist.com
Date:   Sat Dec 20 15:41:15 2014 +1100

fdo#87488 Wrong text rotation inside a preset shape from docx

Preset shape text rotation values are read in a few places and stored in
moRotation. With these changes, moRotation is always read unchanged, but
multiplied by -1 when it's used.

Change-Id: I633d665c21daa69e15fa828a43300f10d2bf2054
Reviewed-on: https://gerrit.libreoffice.org/13561
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk
(cherry picked from commit 921cea89da8adbe714ea8f71169dd6afc42354c4)
Signed-off-by: Andras Timar andras.ti...@collabora.com
Reviewed-on: https://gerrit.libreoffice.org/15084

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ef0feb7..7fea778 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -999,7 +999,10 @@ Reference XShape  Shape::createAndInsert(
 if( getTextBody() )
 {
 sal_Int32 nTextRotateAngle = static_cast sal_Int32 ( 
getTextBody()-getTextProperties().moRotation.get( 0 ) );
-mpCustomShapePropertiesPtr-setTextRotateAngle( 
nTextRotateAngle / 6 );
+/* OOX measures text rotation clockwise in 1/6th degrees,
+   relative to the containing shape. setTextRotateAngle wants
+   degrees anticlockwise. */
+mpCustomShapePropertiesPtr-setTextRotateAngle( -1 * 
nTextRotateAngle / 6 );
 }
 
 SAL_INFO(oox.cscode, ==cscode== shape name: '  msName  
');
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index 80d82a0..f0208b5 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -84,13 +84,16 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( 
ContextHandler2Helper rPa
 // ST_TextVerticalType
 if( rAttribs.hasAttribute( XML_vert ) ) {
 mrTextBodyProp.moVert = rAttribs.getToken( XML_vert );
-bool bRtl = rAttribs.getBool( XML_rtl, false );
 sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz );
-if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 
|| tVert == XML_mongolianVert )
-mrTextBodyProp.moRotation = -540*(tVert==XML_vert270?3:1);
-else
+if (tVert == XML_vert || tVert == XML_eaVert || tVert == 
XML_mongolianVert)
+mrTextBodyProp.moRotation = 540;
+else if (tVert == XML_vert270)
+mrTextBodyProp.moRotation = 540 * 3;
+else {
+bool bRtl = rAttribs.getBool( XML_rtl, false );
 mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode,
 ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB ));
+}
 }
 
 // ST_TextAnchoringType
diff --git a/oox/source/drawingml/transform2dcontext.cxx 
b/oox/source/drawingml/transform2dcontext.cxx
index d3f7f5e..97015f3 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -47,7 +47,7 @@ Transform2DContext::Transform2DContext( 
ContextHandler2Helper rParent, const At
 else
 {
 if( rAttribs.hasAttribute( XML_rot ) )
-mrShape.getTextBody()-getTextProperties().moRotation = 
-rAttribs.getInteger( XML_rot ).get();
+mrShape.getTextBody()-getTextProperties().moRotation = 
rAttribs.getInteger( XML_rot ).get();
 }
 }
 
diff --git a/sw/qa/extras/ooxmlimport/data/fdo87488.docx 
b/sw/qa/extras/ooxmlimport/data/fdo87488.docx
new file mode 100644
index 000..2bd51b6
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo87488.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 44876b9..c4bc13a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -73,13 +73,13 @@ public:
 
 virtual void preTest(const char* filename) SAL_OVERRIDE
 {
-if (OString(filename) == smartart.docx || OString(filename) == 
strict-smartart.docx)
+if (OString(filename) == smartart.docx || OString(filename) == 
strict-smartart.docx || OString(filename) == fdo87488.docx)
 SvtFilterOptions::Get().SetSmartArt2Shape(true);
 }
 
 virtual void postTest(const char* filename) SAL_OVERRIDE
 {
-if 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2015-03-31 Thread Zolnai Tamás
 oox/source/drawingml/table/tablecell.cxx |   11 +++
 sd/qa/unit/data/pptx/bnc910045.pptx  |binary
 sd/qa/unit/import-tests.cxx  |   23 +++
 3 files changed, 34 insertions(+)

New commits:
commit d23f9b40c5d95ab209747417aa543f8b7ecc3d5f
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Fri Dec 5 19:23:01 2014 +0100

bnc#910045 wrong cell fill color defined by table style

Problems were with those table styles which used
color themes to define cell fill color.

Reviewed-on: https://gerrit.libreoffice.org/15089
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Andras Timar andras.ti...@collabora.com
(cherry picked from commit debf3ffb87d607704ddea97f6710c3ceaa9a243d)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Conflicts:
sd/qa/unit/import-tests.cxx

Change-Id: Ibde90df81ff253ba65618dde4038093d1caabfe8

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 1b33659..7c4dd9f 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -116,6 +116,17 @@ void applyTableStylePart( const 
::oox::core::XmlFilterBase rFilterBase,
 ::oox::drawingml::FillPropertiesPtr rPartFillPropertiesPtr( 
rTableStylePart.getFillProperties() );
 if ( rPartFillPropertiesPtr.get() )
 rFillProperties.assignUsed( *rPartFillPropertiesPtr );
+else
+{
+::oox::drawingml::ShapeStyleRef rFillStyleRef = 
rTableStylePart.getStyleRefs()[ XML_fillRef ];
+const Theme* pTheme = rFilterBase.getCurrentTheme();
+if (pTheme  rFillStyleRef.mnThemedIdx != 0 )
+{
+rFillProperties.assignUsed( *pTheme-getFillStyle( 
rFillStyleRef.mnThemedIdx ) );
+sal_Int32 nPhClr = rFillStyleRef.maPhClr.getColor( 
rFilterBase.getGraphicHelper() );
+rFillProperties.maFillColor.setSrgbClr( nPhClr );
+}
+}
 
 applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
 applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
diff --git a/sd/qa/unit/data/pptx/bnc910045.pptx 
b/sd/qa/unit/data/pptx/bnc910045.pptx
new file mode 100644
index 000..5788ea9
Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc910045.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c5fc418..13b23b7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -100,6 +100,7 @@ public:
 void testShapeLineStyle();
 void testBnc862510_6();
 void testBnc862510_7();
+void testBnc910045();
 #if !defined WNT
 void testBnc822341();
 #endif
@@ -144,6 +145,7 @@ public:
 CPPUNIT_TEST(testBnc822341);
 #endif
 
+CPPUNIT_TEST(testBnc910045);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1366,6 +1368,27 @@ void SdFiltersTest::testBnc822341()
 
 #endif
 
+void SdFiltersTest::testBnc910045()
+{
+// Problem with table style which defines cell color with fill style
+::sd::DrawDocShellRef xDocShRef = loadURL( 
getURLFromSrc(/sd/qa/unit/data/pptx/bnc910045.pptx) );
+
+SdDrawDocument *pDoc = xDocShRef-GetDoc();
+CPPUNIT_ASSERT_MESSAGE( no document, pDoc != NULL );
+const SdrPage *pPage = pDoc-GetPage(1);
+CPPUNIT_ASSERT_MESSAGE( no page, pPage != NULL );
+
+sdr::table::SdrTableObj *pTableObj = 
dynamic_castsdr::table::SdrTableObj*(pPage-GetObj(0));
+CPPUNIT_ASSERT( pTableObj );
+uno::Reference table::XCellRange  xTable(pTableObj-getTable(), 
uno::UNO_QUERY_THROW);
+uno::Reference beans::XPropertySet  xCell;
+sal_Int32 nColor;
+
+xCell.set(xTable-getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(5210557), nColor);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2015-03-26 Thread Miklos Vajna
 oox/source/core/xmlfilterbase.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 31433d007cce7d36897277a875c25c5b102e15aa
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Mar 2 08:40:20 2015 +0100

tdf#89774 oox: TotalTime is in minutes

(cherry picked from commit 302f413eec4da8c8572911d08e939186c5ac57cf)

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport5.cxx

Change-Id: Ie65a8adbd077997f4a13914dd8e0ba4d55afd7b7
Reviewed-on: https://gerrit.libreoffice.org/15017
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 3b807df..3a089ad 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -648,7 +648,8 @@ writeAppProperties( XmlFilterBase rSelf, Reference 
XDocumentProperties  xProp
 writeElement( pAppProps, XML_Slides,slides );
 writeElement( pAppProps, XML_Notes, notes );
 #endif  /* def OOXTODO */
-writeElement( pAppProps, XML_TotalTime, 
xProperties-getEditingDuration() );
+// EditingDuration is in seconds, TotalTime is in minutes.
+writeElement( pAppProps, XML_TotalTime, 
xProperties-getEditingDuration() / 60 );
 #ifdef OOXTODO
 writeElement( pAppProps, XML_HiddenSlides,  hidden slides );
 writeElement( pAppProps, XML_MMClips,   mm clips );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2015-01-05 Thread Zolnai Tamás
 oox/source/drawingml/textparagraphproperties.cxx|   12 +
 oox/source/drawingml/textparagraphpropertiescontext.cxx |5 +-
 sd/qa/unit/data/pptx/bnc862510_7.pptx   |binary
 sd/qa/unit/import-tests.cxx |   35 
 4 files changed, 51 insertions(+), 1 deletion(-)

New commits:
commit 50c9a8bf7473bf369ccd7e3060ef732ac6cf58f5
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Mon Dec 22 18:30:43 2014 +0100

bnc#862510: PPTX import: Wrong text horizontal adjustment inside shape.

When alignment is not specified, it should be set to the
default left value just on time, when properties are
pushed to the property set, otherwise uninitialized value
is better.

(cherry picked from commit 7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d)

Conflicts:
sd/qa/unit/import-tests.cxx

Conflicts:
sd/qa/unit/import-tests.cxx

Change-Id: Ic294c5d7cc477f7515aea1c071ad9b67275c012d
Reviewed-on: https://gerrit.libreoffice.org/13607
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/textparagraphproperties.cxx 
b/oox/source/drawingml/textparagraphproperties.cxx
index 76e1622..1e26066 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -28,6 +28,7 @@
 #include com/sun/star/beans/PropertyValue.hpp
 #include com/sun/star/style/TabStop.hpp
 #include com/sun/star/text/PositionAndSpaceMode.hpp
+#include com/sun/star/style/ParagraphAdjust.hpp
 
 #include oox/helper/helper.hxx
 #include oox/helper/propertyset.hxx
@@ -380,6 +381,8 @@ void TextParagraphProperties::apply( const 
TextParagraphProperties rSourceProps
 moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
 if( rSourceProps.mnLevel )
 mnLevel = rSourceProps.mnLevel;
+if( rSourceProps.moParaAdjust )
+moParaAdjust = rSourceProps.moParaAdjust;
 }
 
 void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* 
pFilterBase,
@@ -477,6 +480,15 @@ void TextParagraphProperties::pushToPropSet( const 
::oox::core::XmlFilterBase* p
 aPropSet.setProperty( PROP_ParaTabStops, aSeq );
 }
 }
+
+if ( moParaAdjust )
+{
+aPropSet.setProperty( PROP_ParaAdjust, moParaAdjust.get());
+}
+else
+{
+aPropSet.setProperty( PROP_ParaAdjust, 
com::sun::star::style::ParagraphAdjust_LEFT);
+}
 }
 
 float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx 
b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index e592841..390cb16 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -54,7 +54,10 @@ 
TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H
 PropertyMap rPropertyMap( 
mrTextParagraphProperties.getTextParagraphPropertyMap() );
 
 // ST_TextAlignType
-rPropertyMap.setProperty( PROP_ParaAdjust, GetParaAdjust( 
rAttribs.getToken( XML_algn, XML_l ) ));
+if ( rAttribs.hasAttribute( XML_algn ) )
+{
+mrTextParagraphProperties.getParaAdjust() = GetParaAdjust( 
rAttribs.getToken( XML_algn, XML_l ) );
+}
 // TODO see to do the same with RubyAdjust
 
 // ST_Coordinate32
diff --git a/sd/qa/unit/data/pptx/bnc862510_7.pptx 
b/sd/qa/unit/data/pptx/bnc862510_7.pptx
new file mode 100644
index 000..0eb3bbe
Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc862510_7.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index e5ab540..4ff2da3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -53,6 +53,7 @@
 #include com/sun/star/chart2/data/XDataSequence.hpp
 #include com/sun/star/chart2/data/XNumericalDataSequence.hpp
 #include com/sun/star/table/BorderLine2.hpp
+#include com/sun/star/style/ParagraphAdjust.hpp
 
 #include config_features.h
 
@@ -98,6 +99,7 @@ public:
 void testBnc904423();
 void testShapeLineStyle();
 void testBnc862510_6();
+void testBnc862510_7();
 #if !defined WNT
 void testBnc822341();
 #endif
@@ -137,6 +139,7 @@ public:
 CPPUNIT_TEST(testBnc904423);
 CPPUNIT_TEST(testShapeLineStyle);
 CPPUNIT_TEST(testBnc862510_6);
+CPPUNIT_TEST(testBnc862510_7);
 #if !defined WNT
 CPPUNIT_TEST(testBnc822341);
 #endif
@@ -1291,6 +1294,38 @@ void SdFiltersTest::testBnc862510_6()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testBnc862510_7()
+{
+// Title shape's text was aligned to left instead of center.
+::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/pptx/bnc862510_7.pptx));
+
+uno::Reference drawing::XDrawPagesSupplier  xDoc(
+xDocShRef-GetDoc()-getUnoModel(), uno::UNO_QUERY_THROW );
+
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2015-01-05 Thread Zolnai Tamás
 oox/source/drawingml/shape.cxx|   13 ++-
 sd/qa/unit/data/pptx/bnc862510_6.pptx |binary
 sd/qa/unit/import-tests.cxx   |   40 ++
 3 files changed, 48 insertions(+), 5 deletions(-)

New commits:
commit 4679ba35ad02a720789a8d0c571fafe4122d91a2
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Mon Dec 22 17:53:00 2014 +0100

bnc#862510: PPTX import: Wrong text color inside shape

When theme index is 0, it means it's unset so we should not
apply that.

(cherry picked from commit 89206c472ecf18bfde6824cea8004921cd404365)

Conflicts:
sd/qa/unit/import-tests.cxx

Conflicts:
sd/qa/unit/import-tests.cxx

Change-Id: I62a9cd2a9b4c19f5acffc334d5e8263fe24fc8fd
Reviewed-on: https://gerrit.libreoffice.org/13606
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 93e9789..ef0feb7 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1027,11 +1027,14 @@ Reference XShape  Shape::createAndInsert(
 TextCharacterProperties aCharStyleProperties;
 if( const ShapeStyleRef* pFontRef = getShapeStyleRef( 
XML_fontRef ) )
 {
-if( pTheme )
-if( const TextCharacterProperties* pCharProps = 
pTheme-getFontStyle( pFontRef-mnThemedIdx ) )
-aCharStyleProperties.assignUsed( *pCharProps );
-SAL_INFO(oox.drawingml, OSL_THIS_FUNC  use font 
color);
-aCharStyleProperties.maCharColor.assignIfUsed( 
pFontRef-maPhClr );
+if( pFontRef-mnThemedIdx != 0 )
+{
+if( pTheme )
+if( const TextCharacterProperties* pCharProps = 
pTheme-getFontStyle( pFontRef-mnThemedIdx ) )
+aCharStyleProperties.assignUsed( *pCharProps );
+SAL_INFO(oox.drawingml, OSL_THIS_FUNC  use font 
color);
+aCharStyleProperties.maCharColor.assignIfUsed( 
pFontRef-maPhClr );
+}
 }
 
 Reference  XTextCursor  xAt = xText-createTextCursor();
diff --git a/sd/qa/unit/data/pptx/bnc862510_6.pptx 
b/sd/qa/unit/data/pptx/bnc862510_6.pptx
new file mode 100644
index 000..fc5f008
Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc862510_6.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 68a205e..e5ab540 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -97,6 +97,7 @@ public:
 void testFdo79731();
 void testBnc904423();
 void testShapeLineStyle();
+void testBnc862510_6();
 #if !defined WNT
 void testBnc822341();
 #endif
@@ -135,6 +136,7 @@ public:
 CPPUNIT_TEST(testFdo79731);
 CPPUNIT_TEST(testBnc904423);
 CPPUNIT_TEST(testShapeLineStyle);
+CPPUNIT_TEST(testBnc862510_6);
 #if !defined WNT
 CPPUNIT_TEST(testBnc822341);
 #endif
@@ -1251,6 +1253,44 @@ void SdFiltersTest::testShapeLineStyle()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testBnc862510_6()
+{
+// Black text was imported instead of gray
+::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/pptx/bnc862510_6.pptx));
+
+uno::Reference drawing::XDrawPagesSupplier  xDoc(
+xDocShRef-GetDoc()-getUnoModel(), uno::UNO_QUERY_THROW );
+
+uno::Reference drawing::XDrawPage  xPage(
+xDoc-getDrawPages()-getByIndex(0), uno::UNO_QUERY_THROW );
+
+uno::Reference beans::XPropertySet  xShape(
+xPage-getByIndex(0), uno::UNO_QUERY );
+CPPUNIT_ASSERT_MESSAGE( no shape, xShape.is() );
+
+// Get first paragraph of the text
+uno::Referencetext::XText xText = 
uno::Referencetext::XTextRange(xShape, uno::UNO_QUERY)-getText();
+CPPUNIT_ASSERT_MESSAGE( not a text shape, xText.is() );
+uno::Referencecontainer::XEnumerationAccess paraEnumAccess;
+paraEnumAccess.set(xText, uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration paraEnum = 
paraEnumAccess-createEnumeration();
+uno::Referencetext::XTextRange const xParagraph(paraEnum-nextElement(),
+uno::UNO_QUERY_THROW);
+
+// Get first run of the paragraph
+uno::Referencecontainer::XEnumerationAccess xRunEnumAccess(xParagraph, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRunEnum = 
xRunEnumAccess-createEnumeration();
+uno::Referencetext::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(0x8B8B8B), nCharColor );
+
+xDocShRef-DoClose();
+}
+
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-12-04 Thread Caolán McNamara
 oox/source/vml/vmlformatting.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 9a63f1baddecb61f92eeadc484ac31fffdbc4bbf
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 2 14:51:09 2014 +

Resolves: fdo#70157 fix crash on loading

Change-Id: I0d248a195852c14cd95d4e337823076dd2fbc19d
(cherry picked from commit 8302d048653d9ac25d3cb9ab9277df715053ad6a)
(cherry picked from commit a757e1b1300dde12fb865c1efd64bfd2bef00e2c)
Reviewed-on: https://gerrit.libreoffice.org/13272
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 86b303e..8fca88d 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -378,9 +378,13 @@ void ConversionHelper::decodeVmlPath( ::std::vector 
::std::vector Point   r
 break;
 
 case CLOSE: // 0 param
-rPointLists.back().push_back( rPointLists.back()[ 0 ] );
-rFlagLists.back().push_back( rFlagLists.back()[ 0 ] );
-aCurrentPoint = rPointLists.back().back();
+SAL_WARN_IF(rPointLists.back().empty() || 
rPointLists.back().empty(), oox, empty pointlists at close);
+if (!rPointLists.back().empty()  
!rFlagLists.back().empty())
+{
+rPointLists.back().push_back( rPointLists.back()[ 0 ] 
);
+rFlagLists.back().push_back( rFlagLists.back()[ 0 ] );
+aCurrentPoint = rPointLists.back().back();
+}
 break;
 
 case END: // 0 param
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2014-11-12 Thread Miklos Vajna
 oox/source/export/drawingml.cxx |   13 -
 sd/qa/unit/data/fdo79731.odp|binary
 sd/qa/unit/import-tests.cxx |   12 
 3 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit f597199442bac978c38704705a15af4cb0ab6af2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Nov 5 11:11:45 2014 +0100

fdo#79731 fdo#85813 drawingML export: fix handling of impress tables

(cherry picked from commit 02e52b15908a6d89b4aeb3c349e7414240eb9563)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Conflicts:
oox/source/export/drawingml.cxx
sd/qa/unit/export-tests.cxx

Change-Id: Ia17b14c4b27e808ceab388aa33602875e67433a5

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 641cb4d..96c90c5 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1088,10 +1088,12 @@ void DrawingML::WriteShapeTransformation( Reference 
XShape  rXShape, sal_Int32
 
aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2;
 
aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2;
 }
-}
-if (!bSuppressRotation)
-{
-if (bFlipV) {nRotation=(nRotation+18000)%36000;}
+
+// The RotateAngle property's value is independent from any flipping, 
and that's exactly what we need here.
+uno::Referencebeans::XPropertySet xPropertySet(rXShape, 
uno::UNO_QUERY);
+uno::Referencebeans::XPropertySetInfo xPropertySetInfo = 
xPropertySet-getPropertySetInfo();
+if (xPropertySetInfo-hasPropertyByName(RotateAngle))
+xPropertySet-getPropertyValue(RotateAngle) = nRotation;
 }
 WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( 
aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, 
PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
 }
@@ -1791,7 +1793,8 @@ void DrawingML::WriteText( Reference XInterface  
rXIface, bool bBodyPr, bool b
 if( !enumeration.is() )
 return;
 
-SdrObject* pSdrObject = 
GetSdrObjectFromXShape(uno::Referencedrawing::XShape(rXIface, 
uno::UNO_QUERY_THROW));
+uno::Referencedrawing::XShape xShape(rXIface, uno::UNO_QUERY);
+SdrObject* pSdrObject = xShape.is() ? GetSdrObjectFromXShape(xShape) : 0;
 const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, pSdrObject);
 if (pTxtObj  mpTextExport)
 {
diff --git a/sd/qa/unit/data/fdo79731.odp b/sd/qa/unit/data/fdo79731.odp
new file mode 100644
index 000..d5d094a
Binary files /dev/null and b/sd/qa/unit/data/fdo79731.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 640063a..ede33d6 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -91,6 +91,7 @@ public:
 void testBnc480256();
 void testCreationDate();
 void testBnc584721_4();
+void testFdo79731();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -123,6 +124,7 @@ public:
 CPPUNIT_TEST(testBnc480256);
 CPPUNIT_TEST(testCreationDate);
 CPPUNIT_TEST(testBnc584721_4);
+CPPUNIT_TEST(testFdo79731);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1105,6 +1107,16 @@ void SdFiltersTest::testBnc584721_4()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testFdo79731()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/fdo79731.odp));
+xDocShRef = saveAndReload(xDocShRef, PPTX);
+SdDrawDocument *pDoc = xDocShRef-GetDoc();
+CPPUNIT_ASSERT(pDoc);
+xDocShRef-DoClose();
+}
+
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-11-09 Thread Muthu Subramanian
 oox/source/drawingml/chart/objectformatter.cxx |   21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit ce807b9143baa7a686ab9b2a95899f2c1817a715
Author: Muthu Subramanian muthu.subramanian.karunani...@ericsson.com
Date:   Fri Oct 10 18:59:46 2014 +0530

fdo#54361: Chart background in XLSX is transparent instead of white.

Conflicts:
oox/source/drawingml/chart/objectformatter.cxx

Change-Id: I116e7e8c9046009cfcadc04b5367a6fe25f88d96
Reviewed-on: https://gerrit.libreoffice.org/11910
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index ae45550..53328b9 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -643,7 +643,8 @@ class FillFormatter : public DetailFormatterBase
 public:
 explicitFillFormatter(
 ObjectFormatterData rData,
-const AutoFormatEntry* pAutoFormatEntry );
+const AutoFormatEntry* pAutoFormatEntry,
+const ObjectType eObjType );
 
 /** Converts area formatting to the passed property set. */
 voidconvertFormatting(
@@ -704,7 +705,8 @@ public:
 explicitObjectTypeFormatter(
 ObjectFormatterData rData,
 const ObjectTypeFormatEntry rEntry,
-const ChartSpaceModel rChartSpace );
+const ChartSpaceModel rChartSpace,
+const ObjectType eObjType );
 
 /** Sets frame formatting properties to the passed property set. */
 voidconvertFrameFormatting(
@@ -886,15 +888,14 @@ void LineFormatter::convertFormatting( ShapePropertyMap 
rPropMap, const ModelRe
 aLineProps.pushToPropMap( rPropMap, mrData.mrFilter.getGraphicHelper(), 
getPhColor( nSeriesIdx ) );
 }
 
-
-
-FillFormatter::FillFormatter( ObjectFormatterData rData, const 
AutoFormatEntry* pAutoFormatEntry ) :
+FillFormatter::FillFormatter( ObjectFormatterData rData, const 
AutoFormatEntry* pAutoFormatEntry, const ObjectType eObjType ) :
 DetailFormatterBase( rData, pAutoFormatEntry )
 {
 if( pAutoFormatEntry )
 {
 mxAutoFill.reset( new FillProperties );
-mxAutoFill-moFillType = XML_noFill;
+if( eObjType != OBJECTTYPE_CHARTSPACE )
+mxAutoFill-moFillType = XML_noFill;
 if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() )
 if( const FillProperties* pFillProps = pTheme-getFillStyle( 
pAutoFormatEntry-mnThemedIdx ) )
 *mxAutoFill = *pFillProps;
@@ -975,11 +976,9 @@ void TextFormatter::convertFormatting( PropertySet 
rPropSet, const ModelRef Te
 convertFormatting( rPropSet, lclGetTextProperties( rxTextProp ) );
 }
 
-
-
-ObjectTypeFormatter::ObjectTypeFormatter( ObjectFormatterData rData, const 
ObjectTypeFormatEntry rEntry, const ChartSpaceModel rChartSpace ) :
+ObjectTypeFormatter::ObjectTypeFormatter( ObjectFormatterData rData, const 
ObjectTypeFormatEntry rEntry, const ChartSpaceModel rChartSpace, const 
ObjectType eObjType ) :
 maLineFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoLines,   
rChartSpace.mnStyle ) ),
-maFillFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoFills,   
rChartSpace.mnStyle ) ),
+maFillFormatter(   rData, lclGetAutoFormatEntry( rEntry.mpAutoFills,   
rChartSpace.mnStyle ), eObjType ),
 maEffectFormatter( rData, lclGetAutoFormatEntry( rEntry.mpAutoEffects, 
rChartSpace.mnStyle ) ),
 maTextFormatter(   rData, lclGetAutoTextEntry(   rEntry.mpAutoTexts,   
rChartSpace.mnStyle ), rChartSpace.mxTextProp ),
 mrModelObjHelper( rData.maModelObjHelper ),
@@ -1032,7 +1031,7 @@ ObjectFormatterData::ObjectFormatterData( const 
XmlFilterBase rFilter, const Re
 {
 const ObjectTypeFormatEntry* pEntryEnd = STATIC_ARRAY_END( 
spObjTypeFormatEntries );
 for( const ObjectTypeFormatEntry* pEntry = spObjTypeFormatEntries; pEntry 
!= pEntryEnd; ++pEntry )
-maTypeFormatters[ pEntry-meObjType ].reset( new ObjectTypeFormatter( 
*this, *pEntry, rChartSpace ) );
+maTypeFormatters[ pEntry-meObjType ].reset( new ObjectTypeFormatter( 
*this, *pEntry, rChartSpace, pEntry-meObjType ) );
 
 try
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2014-10-07 Thread Zolnai Tamás
 oox/source/drawingml/color.cxx|   30 
 sd/qa/unit/data/pptx/bnc584721_4.pptx |binary
 sd/qa/unit/import-tests.cxx   |   41 ++
 3 files changed, 61 insertions(+), 10 deletions(-)

New commits:
commit 07c58bbdef95d09c347781df2e7859fda21099f4
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue Sep 30 19:55:25 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/11724
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 5933449..4d05857 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -452,13 +452,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 )
 {
@@ -471,7 +468,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;
 }
@@ -607,10 +604,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 000..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 f9fc0dd..640063a 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -90,6 +90,7 @@ public:
 void testBnc862510_5();
 void testBnc480256();
 void testCreationDate();
+void testBnc584721_4();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -121,6 +122,7 @@ public:
 CPPUNIT_TEST(testBnc862510_5);
 CPPUNIT_TEST(testBnc480256);
 CPPUNIT_TEST(testCreationDate);
+CPPUNIT_TEST(testBnc584721_4);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1064,6 +1066,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::Referencetext::XText xText = 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sw/qa sw/source

2014-10-01 Thread Luboš Luňák
 oox/source/token/properties.txt   |1 
 oox/source/vml/vmlshape.cxx   |   27 ++
 sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |   37 +++
 sw/source/filter/ww8/docxattributeoutput.cxx  |  168 +++---
 5 files changed, 151 insertions(+), 82 deletions(-)

New commits:
commit bccb5eff14b2aebd18fd933c2790d78a2fa940e9
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sat Sep 27 16:59:48 2014 +0200

fix/improve handling of mso-position-(horizontal|vertical)(-relative)

This is a squash of commits f6fa787 to e5bbc721 .

Change-Id: Ieb76ccb2fe8a425af3204de144021b7a731d0778
Reviewed-on: https://gerrit.libreoffice.org/11701
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 988857b..f1b237b 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -339,6 +339,7 @@ OutputPosition
 OverlapSequence
 PageScale
 PageStyle
+PageToggle
 PageViewZoomValue
 PaintTransparent
 ParaAdjust
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index d7783d8..3adf5c8 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -482,12 +482,38 @@ void lcl_SetAnchorType(PropertySet rPropSet, const 
ShapeTypeModel rTypeModel)
 {
 if ( rTypeModel.maPositionHorizontal == center )
 rPropSet.setAnyProperty(PROP_HoriOrient, 
makeAny(text::HoriOrientation::CENTER));
+else if ( rTypeModel.maPositionHorizontal == left )
+rPropSet.setAnyProperty(PROP_HoriOrient, 
makeAny(text::HoriOrientation::LEFT));
+else if ( rTypeModel.maPositionHorizontal == right )
+rPropSet.setAnyProperty(PROP_HoriOrient, 
makeAny(text::HoriOrientation::RIGHT));
+else if ( rTypeModel.maPositionHorizontal == inside )
+{
+rPropSet.setAnyProperty(PROP_HoriOrient, 
makeAny(text::HoriOrientation::LEFT));
+rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True));
+}
+else if ( rTypeModel.maPositionHorizontal == outside )
+{
+rPropSet.setAnyProperty(PROP_HoriOrient, 
makeAny(text::HoriOrientation::RIGHT));
+rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True));
+}
 
 if ( rTypeModel.maPositionHorizontalRelative == page )
 rPropSet.setAnyProperty(PROP_HoriOrientRelation, 
makeAny(text::RelOrientation::PAGE_FRAME));
+else if ( rTypeModel.maPositionVerticalRelative == margin )
+rPropSet.setProperty(PROP_VertOrientRelation, 
text::RelOrientation::PAGE_PRINT_AREA);
+else if ( rTypeModel.maPositionVerticalRelative == text )
+rPropSet.setProperty(PROP_VertOrientRelation, 
text::RelOrientation::FRAME);
 
 if ( rTypeModel.maPositionVertical == center )
 rPropSet.setAnyProperty(PROP_VertOrient, 
makeAny(text::VertOrientation::CENTER));
+else if ( rTypeModel.maPositionVertical == top )
+rPropSet.setAnyProperty(PROP_VertOrient, 
makeAny(text::VertOrientation::TOP));
+else if ( rTypeModel.maPositionVertical == bottom )
+rPropSet.setAnyProperty(PROP_VertOrient, 
makeAny(text::VertOrientation::BOTTOM));
+else if ( rTypeModel.maPositionVertical == inside )
+rPropSet.setAnyProperty(PROP_VertOrient, 
makeAny(text::VertOrientation::LINE_TOP));
+else if ( rTypeModel.maPositionVertical == outside )
+rPropSet.setAnyProperty(PROP_VertOrient, 
makeAny(text::VertOrientation::LINE_BOTTOM));
 
 if ( rTypeModel.maPosition == absolute )
 {
@@ -504,7 +530,6 @@ void lcl_SetAnchorType(PropertySet rPropSet, const 
ShapeTypeModel rTypeModel)
 }
 else
 {
-// Vertical placement relative to margin, because parent style 
must not modify vertical position
 rPropSet.setProperty(PROP_VertOrientRelation, 
text::RelOrientation::FRAME);
 }
 }
diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx 
b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx
new file mode 100644
index 000..2fb28ec
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/bnc884615-mso-position.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5590246..18c15fa 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3658,6 +3658,43 @@ DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, 
footer-body-distance.docx)
 
 #endif
 
+DECLARE_OOXMLEXPORT_TEST(testMsoPosition, bnc884615-mso-position.docx)
+{
+if(xmlDocPtr doc = parseExport(word/footer1.xml))
+{
+// We write the frames out in different order than they were read, so 
check it's the correct
+// textbox first by checking width. These tests may need reordering if 
that gets fixed.
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sw/qa

2014-10-01 Thread Caolán McNamara
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   10 +-
 sw/qa/core/data/ooxml/pass/fdo79129.docx|binary
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 97291b92b70249c1bcdca33425585b201a1822db
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Sep 30 10:43:37 2014 +0100

Resolves: fdo#79129 Crash in oox::drawingml::LayoutNode::setupShape

Change-Id: I0bafd2c43d29806eea0ff0cb165e67aece53488f
Reviewed-on: https://gerrit.libreoffice.org/11726
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx 
b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index ba1f857..fc07a90 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 000..46ff0f5
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo79129.docx differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2014-09-26 Thread Matúš Kukan
 oox/source/drawingml/table/tablecell.cxx |   55 ++-
 sd/qa/unit/import-tests.cxx  |   12 ++
 2 files changed, 45 insertions(+), 22 deletions(-)

New commits:
commit 3fd148ace5d69fe4d7179a5804a16bf8d86a64c5
Author: Matúš Kukan matus.ku...@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)
Reviewed-on: https://gerrit.libreoffice.org/11652
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 2c1fa3c..1b33659 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, 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-09-26 Thread Caolán McNamara
 oox/source/docprop/ooxmldocpropimport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d468017ababdf4d2bb96c662373c96ec06c6c0c
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Sep 26 11:16:18 2014 +0100

Resolves: fdo#84261 unexpected exception - clang builds terminate

Change-Id: I545ed112b54fb3d81e67b0f42230811cd48de626
(cherry picked from commit 465270077e385946c47235363c1120846d5d)
Reviewed-on: https://gerrit.libreoffice.org/11653
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/oox/source/docprop/ooxmldocpropimport.cxx 
b/oox/source/docprop/ooxmldocpropimport.cxx
index 4253498..8b60efa 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -63,7 +63,7 @@ Reference XInterface  SAL_CALL 
DocumentPropertiesImport_createInstance( const
 
 namespace {
 
-Sequence InputSource  lclGetRelatedStreams( const Reference XStorage  
rxStorage, const OUString rStreamType ) throw (RuntimeException)
+Sequence InputSource  lclGetRelatedStreams( const Reference XStorage  
rxStorage, const OUString rStreamType ) throw (RuntimeException, 
css::io::IOException)
 {
 Reference XRelationshipAccess  xRelation( rxStorage, UNO_QUERY_THROW );
 Reference XHierarchicalStorageAccess  xHierarchy( rxStorage, 
UNO_QUERY_THROW );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-09-17 Thread Matúš Kukan
 oox/source/drawingml/graphicshapecontext.cxx |   40 ++-
 1 file changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 5847fbef3052b2606a931860ee8cd40963bcd39a
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Fri Sep 12 16:08:34 2014 +0200

bnc#591147: OOXML import: Import video file too.

Change-Id: Ie9b6c5ff866269e5d7a26d025cb1c0d884ff1134
(cherry picked from commit b7006f3c2f8f71f4d4721c6e5cdc122628c756f0)
Reviewed-on: https://gerrit.libreoffice.org/11469
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/graphicshapecontext.cxx 
b/oox/source/drawingml/graphicshapecontext.cxx
index db04d5c..4b7905e 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -47,6 +47,22 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::xml::sax;
 using namespace ::oox::core;
 
+static OUString lcl_CopyToTempFile(const OUString rStream, const 
oox::core::XmlFilterBase rFilter)
+{
+if (rStream.isEmpty())
+return OUString();
+
+Reference XInputStream  xInStrm( rFilter.openInputStream(rStream), 
UNO_SET_THROW );
+Reference XTempFile  xTempFile( 
TempFile::create(rFilter.getComponentContext()) );
+Reference XOutputStream  xOutStrm( xTempFile-getOutputStream(), 
UNO_SET_THROW );
+oox::BinaryXOutputStream aOutStrm( xOutStrm, false );
+oox::BinaryXInputStream aInStrm( xInStrm, false );
+aInStrm.copyToStream( aOutStrm );
+
+xTempFile-setRemoveFile( false );
+return xTempFile-getUri();
+}
+
 namespace oox {
 namespace drawingml {
 
@@ -70,19 +86,17 @@ ContextHandlerRef GraphicShapeContext::onCreateContext( 
sal_Int32 aElementToken,
 case XML_wavAudioFile:
 {
 getEmbeddedWAVAudioFile( getRelations(), 
rAttribs.getFastAttributeList(), mpShapePtr-getGraphicProperties().maAudio );
-if( !mpShapePtr-getGraphicProperties().maAudio.msEmbed.isEmpty() )
-{
-Reference XComponentContext  xContext = 
comphelper::getProcessComponentContext();
-Reference XInputStream  xInStrm( 
getFilter().openInputStream( mpShapePtr-getGraphicProperties().maAudio.msEmbed 
), UNO_SET_THROW );
-Reference XTempFile  xTempFile( TempFile::create(xContext) );
-Reference XOutputStream  xOutStrm( 
xTempFile-getOutputStream(), UNO_SET_THROW );
-BinaryXOutputStream aOutStrm( xOutStrm, false );
-BinaryXInputStream aInStrm( xInStrm, false );
-aInStrm.copyToStream( aOutStrm );
-
-xTempFile-setRemoveFile( false );
-mpShapePtr-getGraphicProperties().maAudio.msEmbed = 
xTempFile-getUri();
-}
+mpShapePtr-getGraphicProperties().maAudio.msEmbed =
+lcl_CopyToTempFile( 
mpShapePtr-getGraphicProperties().maAudio.msEmbed, getFilter() );
+}
+break;
+case XML_audioFile:
+case XML_videoFile:
+{
+OUString rPath = getRelations().getFragmentPathFromRelId(
+rAttribs.getString(R_TOKEN(link)).get() );
+mpShapePtr-getGraphicProperties().maAudio.msEmbed =
+lcl_CopyToTempFile( rPath, getFilter() );
 }
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-09-05 Thread Markus Mohrhard
 oox/source/drawingml/colorchoicecontext.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 71d25406d9039633fea0bc07132ed180d8f661e6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Sep 3 19:55:35 2014 +0200

MSO finally decided to follow the spec, fdo#83312

Change-Id: I8c611b49e3bf4645736425bd33c2994ae2c28337
Reviewed-on: https://gerrit.libreoffice.org/11270
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/drawingml/colorchoicecontext.cxx 
b/oox/source/drawingml/colorchoicecontext.cxx
index 1ee3129..9891bf1 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -111,7 +111,17 @@ void ColorValueContext::onStartElement( const 
AttributeList rAttribs )
 case A_TOKEN( satOff ):
 case A_TOKEN( shade ):
 case A_TOKEN( tint ):
-mrColor.addTransformation( nElement, rAttribs.getInteger( XML_val, 
0 ) );
+{
+OUString aValue = rAttribs.getString( XML_val, OUString() );
+sal_Int32 nVal = 0;
+if (aValue.endsWith(%))
+{
+nVal = aValue.toDouble() * PER_PERCENT;
+}
+else
+nVal = rAttribs.getInteger(XML_val, 0);
+mrColor.addTransformation( nElement, nVal );
+}
 break;
 case A_TOKEN( comp ):
 case A_TOKEN( gamma ):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-08-29 Thread Tomaž Vajngerl
 oox/source/export/drawingml.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit eed9b96cd65816f2f03b3ad00994d26d6a3cf783
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Thu Aug 28 13:32:38 2014 +0200

bnc#822347: if number type is not set, skip numbering

If numbering is detected then (level is  0) and the number type
is not set, the defult bullet symbol is written. This is not
correct as the default should be SVX_NUM_NUMBER_NONE which should
skip numbering or set it to none. With this change the numbering
is skipped (as in MSO).

(cherry picked from commit 14fa2698f2f651343675761e75be01b84c4c5ff1)

Conflicts:
oox/source/export/drawingml.cxx

Change-Id: I8d08a6325509c7bd6f96f64c8d29e5f3045458ca
Reviewed-on: https://gerrit.libreoffice.org/11181
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index fe55aa8..2ef0d1f 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1458,7 +1458,7 @@ void DrawingML::WriteParagraphNumbering( Reference 
XPropertySet  rXPropSet, sa
 
 if ( nPropertyCount ) {
 
-sal_Int16 nNumberingType = -1;
+sal_Int16 nNumberingType = SVX_NUM_NUMBER_NONE;
 bool bSDot = false;
 bool bPBehind = false;
 bool bPBoth = false;
@@ -1520,6 +1520,9 @@ void DrawingML::WriteParagraphNumbering( Reference 
XPropertySet  rXPropSet, sa
 }
 }
 
+if (nNumberingType == SVX_NUM_NUMBER_NONE)
+return;
+
 const char* pAutoNumType = GetAutoNumType( nNumberingType, 
bSDot, bPBehind, bPBoth );
 
 if( nLevel = 0 ) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2014-08-28 Thread Miklos Vajna
 oox/source/ppt/pptimport.cxx |2 ++
 sd/qa/unit/import-tests.cxx  |   16 
 2 files changed, 18 insertions(+)

New commits:
commit 97bd79cbd866dbb4944c774b4e6161cb990f6ec2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Aug 28 10:08:02 2014 +0200

PPTX import: fix missing document metadata

Without this, the creation / modification date is lost on import.

(cherry picked from commit ef2668bad976f1fbb70759887cafd35ea7833655)

Conflicts:
sd/qa/unit/import-tests.cxx

Change-Id: I0b74ac91aee7b8b3e0bc763247086a3a39816bc1
Reviewed-on: https://gerrit.libreoffice.org/11167
Reviewed-by: Zolnai Tamás tamas.zol...@collabora.com
Tested-by: Zolnai Tamás tamas.zol...@collabora.com

diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index df15d77..bb200f8 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -82,6 +82,8 @@ bool PowerPointImport::importDocument() throw()
 file:///path-to-oox-module/source/dump/pptxdumper.ini. */
 OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
 
+importDocumentProperties();
+
 OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( 
officeDocument );
 FragmentHandlerRef xPresentationFragmentHandler( new 
PresentationFragmentHandler( *this, aFragmentPath ) );
 maTableStyleListPath = 
xPresentationFragmentHandler-getFragmentPathFromFirstTypeFromOfficeDoc( 
tableStyles );
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 8d43ea0..d6a9cfd 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -31,7 +31,9 @@
 #include svx/svdoole2.hxx
 #include svx/xflclit.hxx
 #include animations/animationnodehelper.hxx
+#include sax/tools/converter.hxx
 
+#include com/sun/star/document/XDocumentPropertiesSupplier.hpp
 #include com/sun/star/drawing/XDrawPage.hpp
 #include com/sun/star/drawing/XDrawPagesSupplier.hpp
 #include com/sun/star/animations/XAnimationNodeSupplier.hpp
@@ -81,6 +83,7 @@ public:
 void testBnc870233_2();
 void testBnc880763();
 void testBnc862510_5();
+void testCreationDate();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -109,6 +112,7 @@ public:
 CPPUNIT_TEST(testBnc870233_2);
 CPPUNIT_TEST(testBnc880763);
 CPPUNIT_TEST(testBnc862510_5);
+CPPUNIT_TEST(testCreationDate);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -763,6 +767,18 @@ void SdFiltersTest::testBnc870237()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testCreationDate()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/fdo71434.pptx));
+uno::Referencedocument::XDocumentPropertiesSupplier 
xDocumentPropertiesSupplier(xDocShRef-GetModel(), uno::UNO_QUERY);
+uno::Referencedocument::XDocumentProperties xDocumentProperties = 
xDocumentPropertiesSupplier-getDocumentProperties();
+util::DateTime aDate = xDocumentProperties-getCreationDate();
+OUStringBuffer aBuffer;
+sax::Converter::convertDateTime(aBuffer, aDate, 0);
+// Metadata wasn't imported, this was -00-00.
+CPPUNIT_ASSERT_EQUAL(OUString(2013-11-09T10:37:56), 
aBuffer.makeStringAndClear());
+}
+
 void SdFiltersTest::testBnc870233_1()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/pptx/bnc870233_1.pptx));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-08-25 Thread Matúš Kukan
 oox/source/ppt/pptshape.cxx|   40 +
 oox/source/ppt/pptshapecontext.cxx |5 ++--
 2 files changed, 26 insertions(+), 19 deletions(-)

New commits:
commit 092a3a093b11485cb3c951cb36b56ce08218f1e4
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Aug 19 16:26:12 2014 +0200

bnc#880448: Improved handling of placeholder shapes

If subTitle placeholder is not found, try body instead of title.
And use body text styles instead of title, for subTitle.

Also improve PPTShape::findPlaceholder to find placeholder
with just nSecondSubType type without the same index.

(cherry picked from commit 2a7119021edea8346e4673d57cac3f051a5d0968)

Conflicts:
oox/source/ppt/pptshape.cxx

Change-Id: I470e7268088eb989fb934007dfcf704f67d8cb1d
Reviewed-on: https://gerrit.libreoffice.org/11065
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 70b2d79..ee8b1ab 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -90,12 +90,10 @@ oox::drawingml::TextListStylePtr 
PPTShape::getSubTypeTextListStyle( const SlideP
 {
 case XML_ctrTitle :
 case XML_title :
-case XML_subTitle :
 pTextListStyle = rSlidePersist.getMasterPersist().get() ? 
rSlidePersist.getMasterPersist()-getTitleTextStyle() : 
rSlidePersist.getTitleTextStyle();
 break;
+case XML_subTitle :
 case XML_obj :
-pTextListStyle = rSlidePersist.getMasterPersist().get() ? 
rSlidePersist.getMasterPersist()-getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
-break;
 case XML_body :
 if ( rSlidePersist.isNotesPage() )
 pTextListStyle = rSlidePersist.getMasterPersist().get() ? 
rSlidePersist.getMasterPersist()-getNotesTextStyle() : 
rSlidePersist.getNotesTextStyle();
@@ -149,7 +147,7 @@ void PPTShape::addShape(
 sServiceName = OUString();
 else {
 sServiceName = 
com.sun.star.presentation.SubtitleShape;
-aMasterTextListStyle = 
rSlidePersist.getMasterPersist().get() ? 
rSlidePersist.getMasterPersist()-getTitleTextStyle() : 
rSlidePersist.getTitleTextStyle();
+aMasterTextListStyle = 
rSlidePersist.getMasterPersist().get() ? 
rSlidePersist.getMasterPersist()-getBodyTextStyle() : 
rSlidePersist.getBodyTextStyle();
 }
 }
 break;
@@ -392,7 +390,8 @@ namespace
 // 1. ph with nFirstSubType and the same oSubTypeIndex
 // 2. ph with nFirstSubType
 // 3. ph with nSecondSubType and the same oSubTypeIndex
-// 4. ph with the same oSubTypeIndex
+// 4. ph with nSecondSubType
+// 5. ph with the same oSubTypeIndex
 oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, 
sal_Int32 nSecondSubType,
 const OptValue sal_Int32  oSubTypeIndex, std::vector 
oox::drawingml::ShapePtr  rShapes, bool bMasterOnly )
 {
@@ -400,6 +399,7 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( 
sal_Int32 nFirstSubType, sal
 oox::drawingml::ShapePtr aChoiceShapePtr1;
 oox::drawingml::ShapePtr aChoiceShapePtr2;
 oox::drawingml::ShapePtr aChoiceShapePtr3;
+oox::drawingml::ShapePtr aChoiceShapePtr4;
 std::vector oox::drawingml::ShapePtr ::reverse_iterator aRevIter( 
rShapes.rbegin() );
 while (aRevIter != rShapes.rend())
 {
@@ -414,27 +414,31 @@ oox::drawingml::ShapePtr PPTShape::findPlaceholder( 
sal_Int32 nFirstSubType, sal
 }
 else if ((*aRevIter)-getSubType() == nSecondSubType  
!aChoiceShapePtr2.get())
 aChoiceShapePtr2 = *aRevIter;
-else if (!aChoiceShapePtr3.get())
-aChoiceShapePtr3 = *aRevIter;
+else if (!aChoiceShapePtr4.get())
+aChoiceShapePtr4 = *aRevIter;
 }
 else if ((*aRevIter)-getSubType() == nFirstSubType  
!aChoiceShapePtr1.get())
 aChoiceShapePtr1 = *aRevIter;
+else if ((*aRevIter)-getSubType() == nSecondSubType  
!aChoiceShapePtr3.get())
+aChoiceShapePtr3 = *aRevIter;
 }
 std::vector oox::drawingml::ShapePtr  rChildren = 
(*aRevIter)-getChildren();
-aChoiceShapePtr3 = findPlaceholder( nFirstSubType, nSecondSubType, 
oSubTypeIndex, rChildren, bMasterOnly );
-if (aChoiceShapePtr3.get())
+aChoiceShapePtr4 = findPlaceholder( nFirstSubType, nSecondSubType, 
oSubTypeIndex, rChildren, bMasterOnly );
+if (aChoiceShapePtr4.get())
 {
-if (aChoiceShapePtr3-getSubType() == nFirstSubType)
+if (aChoiceShapePtr4-getSubType() == nFirstSubType)
 {
-if (aChoiceShapePtr3-getSubTypeIndex() 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-08-12 Thread Matúš Kukan
 oox/source/drawingml/textbodypropertiescontext.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 65b8df84370617b080f20fb0aa18ebe84eb0af3e
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Thu Jul 24 20:03:43 2014 +0200

bnc#887227: Do not set TextAutoGrowHeight for vertical text.

It's horribly broken and it would resize text box
horizontally which is not supposed to happen.

Change-Id: I201ec8dbcddca56d21bf46ea8ee838d01923c442
(cherry picked from commit d068f13596f6d1023a70d98ec2059d38ad6fd777)
Reviewed-on: https://gerrit.libreoffice.org/10541
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx 
b/oox/source/drawingml/textbodypropertiescontext.cxx
index 315f679..80d82a0 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -123,7 +123,11 @@ ContextHandlerRef 
TextBodyPropertiesContext::onCreateContext( sal_Int32 aElement
 mrTextBodyProp.maPropertyMap.setProperty( 
PROP_TextAutoGrowHeight, false);
 break;
 case A_TOKEN( spAutoFit ):
-mrTextBodyProp.maPropertyMap.setProperty( 
PROP_TextAutoGrowHeight, true);
+{
+const sal_Int32 tVert = mrTextBodyProp.moVert.get( 
XML_horz );
+if( tVert != XML_vert  tVert != XML_eaVert  tVert != 
XML_vert270  tVert != XML_mongolianVert )
+mrTextBodyProp.maPropertyMap.setProperty( 
PROP_TextAutoGrowHeight, true);
+}
 break;
 
 case A_TOKEN( scene3d ):// CT_Scene3D
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-08-11 Thread Matúš Kukan
 oox/source/drawingml/chart/objectformatter.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5387fc2f3935c685e58c0c98b1e9444b80a7015b
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jul 29 07:53:22 2014 +0200

bnc#862510: PPTX import: Properly show data labels in percent format.

Usually, General is 0.00 number format, but in this case, when we
want to show percent value, MSO writes that instead of 0%.

Change-Id: I748719765f58e66f9f3fb43c2b527c6823ef6fa1
(cherry picked from commit 5f47e319428a703ea53ce49d166e7628aaa60789)
Reviewed-on: https://gerrit.libreoffice.org/10779
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index d406ce9..54b41cc 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1135,9 +1135,12 @@ void ObjectFormatter::convertNumberFormat( PropertySet 
rPropSet, const NumberFo
 sal_Int32 nPropId = bPercentFormat ? PROP_PercentageNumberFormat : 
PROP_NumberFormat;
 try
 {
-sal_Int32 nIndex = 
rNumberFormat.maFormatCode.equalsIgnoreAsciiCase(general) ?
+bool bGeneral = 
rNumberFormat.maFormatCode.equalsIgnoreAsciiCase(general);
+sal_Int32 nIndex = bGeneral  !bPercentFormat ?
 mxData-mxNumTypes-getStandardIndex( mxData-maFromLocale ) :
-mxData-mxNumFmts-addNewConverted( 
rNumberFormat.maFormatCode, mxData-maEnUsLocale, mxData-maFromLocale );
+mxData-mxNumFmts-addNewConverted(
+bGeneral ? OUString(0%) : rNumberFormat.maFormatCode,
+mxData-maEnUsLocale, mxData-maFromLocale );
 if( nIndex = 0 )
 rPropSet.setProperty( nPropId, nIndex );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-08-11 Thread Matúš Kukan
 oox/source/drawingml/chart/modelbase.cxx   |3 +--
 oox/source/drawingml/chart/objectformatter.cxx |4 +++-
 oox/source/drawingml/chart/seriesconverter.cxx |5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4744400afc9c2be99f62b12180fa33b43acef564
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jul 29 21:10:22 2014 +0200

Fix some number format issues, bnc#862510

Set LinkNumberFormatToSource to false, so that format code is not
ignored.
Also, do not inherit format code common for all labels, if there is
specific format code for a data label.

Change-Id: I505311d5df641d61e616e354734bd332609fa122
(cherry picked from commit c8cc89ff802d86b1f3a69afe1b4835b7df7f70c7)
Reviewed-on: https://gerrit.libreoffice.org/10780
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/oox/source/drawingml/chart/modelbase.cxx 
b/oox/source/drawingml/chart/modelbase.cxx
index d1e87eb..79af50b 100644
--- a/oox/source/drawingml/chart/modelbase.cxx
+++ b/oox/source/drawingml/chart/modelbase.cxx
@@ -34,8 +34,7 @@ NumberFormat::NumberFormat() :
 void NumberFormat::setAttributes( const AttributeList rAttribs )
 {
 maFormatCode = rAttribs.getString( XML_formatCode, OUString() );
-// default is 'false', not 'true' as specified
-mbSourceLinked = rAttribs.getBool( XML_sourceLinked, false );
+// TODO: if XML_sourceLinked is true, c:formatCode should be used 
instead.
 }
 
 
diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index 54b41cc..6360fc2 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1150,7 +1150,9 @@ void ObjectFormatter::convertNumberFormat( PropertySet 
rPropSet, const NumberFo
 append( OUStringToOString( rNumberFormat.maFormatCode, 
osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() );
 }
 
-rPropSet.setProperty(PROP_LinkNumberFormatToSource, 
makeAny(rNumberFormat.mbSourceLinked));
+// Format code is ignored if LinkNumberFormatToSource is set to 
true :-/
+// See AxisHelper::getExplicitNumberFormatKeyForAxis()
+rPropSet.setProperty(PROP_LinkNumberFormatToSource, 
makeAny(rNumberFormat.maFormatCode.isEmpty()));
 }
 }
 
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index bcb8d60..6febc3f 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -253,9 +253,8 @@ void DataLabelsConverter::convertFromModel( const 
Reference XDataSeries  rxDa
 // data point label settings
 for( DataLabelsModel::DataLabelVector::iterator aIt = 
mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; 
++aIt )
 {
-(*aIt)-maNumberFormat.maFormatCode = 
mrModel.maNumberFormat.maFormatCode;
-if( !mrModel.maNumberFormat.maFormatCode.isEmpty() )
-(*aIt)-maNumberFormat.mbSourceLinked = false;
+if ((*aIt)-maNumberFormat.maFormatCode.isEmpty())
+(*aIt)-maNumberFormat = mrModel.maNumberFormat;
 
 DataLabelConverter aLabelConv( *this, **aIt );
 aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-25 Thread Matúš Kukan
 oox/source/drawingml/textparagraph.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 078d191f9bac43c5c52def4f35e6259520b94f13
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Thu Jul 24 15:46:13 2014 +0200

bnc#862510: PPTX import: bullets have color as following text by default.

aTextCharacterStyle contains font theme color set in Shape::createAndInsert.

Change-Id: I55e66aeaa7176fbd3f64dcdf075d411f460947d4
(cherry picked from commit d60cec0e60c5c0880f8098d39443c391abed80b2)
Reviewed-on: https://gerrit.libreoffice.org/10516
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index e220966..8dcd8b5 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -113,6 +113,8 @@ void TextParagraph::insertAt(
 if( !aioBulletList.hasProperty( PROP_BulletColor )  
maRuns.size()  0
  
(*maRuns.begin())-getTextCharacterProperties().maCharColor.isUsed() )
 aioBulletList.setProperty( PROP_BulletColor, 
(*maRuns.begin())-getTextCharacterProperties().maCharColor.getColor( 
rFilterBase.getGraphicHelper() ));
+if( !aioBulletList.hasProperty( PROP_BulletColor )  
aTextCharacterStyle.maCharColor.isUsed() )
+aioBulletList.setProperty( PROP_BulletColor, 
aTextCharacterStyle.maCharColor.getColor( rFilterBase.getGraphicHelper() ));
 
 float fCharacterSize = nCharHeight  0 ? GetFontHeight ( 
nCharHeight ) : pTextParagraphStyle-getCharHeightPoints( 12 );
 aParaProp.pushToPropSet( rFilterBase, xProps, aioBulletList, 
pTextParagraphStyle-getBulletList(), true, fCharacterSize, true );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-23 Thread Heena Gupta
 oox/source/drawingml/chart/chartspaceconverter.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit ef5814e564cc92ae005887ecedeea25243a29491
Author: Heena Gupta heena.h.gu...@ericsson.com
Date:   Tue Jul 22 22:18:19 2014 +0530

fdo#54361: Chart background in XLSX is transparent instead of white

Cherry-picked from
53b9adc135f4abb086c740582e5f85cea710287d
and
6d3269ad94bbad8abae5703edc86d356bf14

Change-Id: I96d86854484deb7b5c0b99739fed60a430f2f957
Reviewed-on: https://gerrit.libreoffice.org/10468
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx 
b/oox/source/drawingml/chart/chartspaceconverter.cxx
index e24388d..2238fe2 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -92,7 +92,10 @@ void ChartSpaceConverter::convertFromModel( const Reference 
XShapes  rxExtern
 
 // formatting of the chart background
 PropertySet aBackPropSet( getChartDocument()-getPageBackground() );
-getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, 
OBJECTTYPE_CHARTSPACE );
+if( mrModel.mxShapeProp.is() )
+{
+getFormatter().convertFrameFormatting( aBackPropSet, 
mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
+}
 
 // convert plot area (container of all chart type groups)
 PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-21 Thread Matúš Kukan
 oox/source/drawingml/textrun.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 2762bb1b1b57d0eec2d8cd2c092e52ef082c50b6
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Fri Jul 18 09:23:17 2014 +0200

bnc#887230: always use theme color for hyperlinks in Impress

Change-Id: I888f107c61037162439ad2d1ba99ad8185532f71
(cherry picked from commit 92f74f6ccb5a55807724db85815f7ea0c49370e0)
Reviewed-on: https://gerrit.libreoffice.org/10384
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index 9537948..8e10553 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -144,8 +144,7 @@ sal_Int32 TextRun::insertAt(
 
 xTextFieldCursor-gotoEnd( sal_True );
 
-if ( !maTextCharacterProperties.maCharColor.isUsed() )
-aTextCharacterProps.maCharColor.setSchemeClr( XML_hlink );
+aTextCharacterProps.maCharColor.setSchemeClr( XML_hlink );
 if ( !maTextCharacterProperties.moUnderline.has() )
 aTextCharacterProps.moUnderline.set( XML_sng );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-18 Thread Matúš Kukan
 oox/source/drawingml/fillproperties.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9451e52b449210a83502b337c6fcc0c240daa576
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Fri Jul 18 10:04:09 2014 +0200

use rtl::math::round here to get the same number on 32/64bit platforms

This fixes sd_import_tests where 100*0.35 was 34 on 32bit platform.

Change-Id: I45705326e91892beb814bd94e074b0a652709768
(cherry picked from commit ba6da9545764f2545313ba085ed4a096165180fd)
Reviewed-on: https://gerrit.libreoffice.org/10385
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 89938ca..330054d 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -37,6 +37,7 @@
 #include oox/drawingml/drawingmltypes.hxx
 #include oox/drawingml/shapepropertymap.hxx
 #include oox/token/tokens.hxx
+#include rtl/math.hxx
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::drawing;
@@ -568,7 +569,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap 
rPropMap,
 if( aEndColor.hasTransparency() )
 nEndTrans = aEndColor.getTransparency()*255/100;
 
-aGradient.Border = 100*nBorder;
+aGradient.Border = rtl::math::round(100*nBorder);
 }
 
 // push gradient or named gradient to property map
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-17 Thread Matúš Kukan
 oox/source/drawingml/table/tableproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8c148bd93ec2fe1aaccbbc583d93784f392edeb8
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jul 15 10:58:51 2014 +0200

bnc#887225: OOXML import: Correctly apply table style for lastRow.

nMaxColumn and nMaxRow are indexes, so use size() - 1.

Change-Id: I20055e55cf2464710fe553fb8067bad13a339084
(cherry picked from commit 47645734c350f244b4a5642a709132ca1b7dc75d)
Reviewed-on: https://gerrit.libreoffice.org/10331
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/table/tableproperties.cxx 
b/oox/source/drawingml/table/tableproperties.cxx
index e7f5799..db55c67 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -288,7 +288,7 @@ void TableProperties::pushToPropSet( const 
::oox::core::XmlFilterBase rFilterBa
 
 Reference XCellRange  xCellRange( xTable, UNO_QUERY_THROW );
 rTableCell.pushToXCell( rFilterBase, pMasterTextListStyle, 
xCellRange-getCellByPosition( nColumn, nRow ), *this, rTableStyle,
-nColumn, aTableRowIter-getTableCells().size(), nRow, 
mvTableRows.size() );
+nColumn, aTableRowIter-getTableCells().size()-1, nRow, 
mvTableRows.size()-1 );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-17 Thread Matúš Kukan
 oox/source/drawingml/table/tablecell.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit d6063cf9fd93b630a0065dfbe51c66228a704b1f
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jul 15 11:28:30 2014 +0200

Do not prefer bandRow over firstCol/lastCol, nor the same with bandCol.

Change-Id: I0c573d721212c870e9ecc99ba5e8494073e09aaf
(cherry picked from commit 5d2f12a44d2af3e42e0c3a17ff556f5ada27b1b8)
Reviewed-on: https://gerrit.libreoffice.org/10332
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 53d8b42..baa1556 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -228,7 +228,9 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase rFilterBase, ::oo
 if ( rProperties.isBandRow() )
 {
 if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) 
-( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) )
+( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) 
+( !rProperties.isFirstCol() || ( nColumn != 0 ) ) 
+( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) )
 {
 sal_Int32 nBand = nRow;
 if ( rProperties.isFirstRow() )
@@ -303,7 +305,9 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase rFilterBase, ::oo
 }
 if ( rProperties.isBandCol() )
 {
-if ( ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) 
+if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) 
+( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) 
+( !rProperties.isFirstCol() || ( nColumn != 0 ) ) 
 ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) )
 {
 sal_Int32 nBand = nColumn;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source vcl/source

2014-07-15 Thread Caolán McNamara
 oox/source/export/drawingml.cxx |   34 ++
 vcl/source/gdi/cvtgrf.cxx   |2 ++
 2 files changed, 28 insertions(+), 8 deletions(-)

New commits:
commit cd6f03d6f9ceea88e486788b09606c1efcaa4f1f
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jul 14 12:13:21 2014 +0100

Related: fdo#52226 ensure graphics are swapped in on DrawingML::WriteImage

I imagine it would be best that the Graphics were delivered pre-swapped in 
by
higher levels in case there are second level caches or more complex caching
systemed wrapped around it, so warn about it in debug mode but give it a
last-ditch shot anyway. i.e. while the .docx problem should be fixed there
is a report of a very similar .xlsx problem

Change-Id: Ie40ee10fe5cba8ff9c321f47b83e33ee2c1425fd
(cherry picked from commit 6e580f3f53ae2de086a08c8ba1958b67874eb9c5)
Reviewed-on: https://gerrit.libreoffice.org/10299
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 05faa6d..fe55aa8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -775,14 +775,32 @@ OUString DrawingML::WriteImage( const Graphic rGraphic , 
bool bRelPathToMedia )
 break;
 default: {
 GraphicType aType = rGraphic.GetType();
-if ( aType == GRAPHIC_BITMAP ) {
-GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
-sMediaType = image/png;
-pExtension = .png;
-} else if ( aType == GRAPHIC_GDIMETAFILE ) {
-GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
-sMediaType = image/x-emf;
-pExtension = .emf;
+if ( aType == GRAPHIC_BITMAP || aType == GRAPHIC_GDIMETAFILE) {
+bool bSwapped = rGraphic.IsSwapOut();
+
+//Warn rather than just happily swap in because of the comments
+//in the sw export filters about needing to go through the
+//hairy SwGrfNode::SwapIn which we would subvert by swapping in
+//without it knowing about it, so while those ones are fixed we
+//probably have to assume that we should ideally be presented
+//here with already swapped in graphics.
+SAL_WARN_IF(bSwapped, oox, attempted to output swapped out 
graphic);
+
+if (bSwapped)
+const_castGraphic(rGraphic).SwapIn();
+
+if ( aType == GRAPHIC_BITMAP ) {
+GraphicConverter::Export( aStream, rGraphic, CVT_PNG );
+sMediaType = image/png;
+pExtension = .png;
+} else {
+GraphicConverter::Export( aStream, rGraphic, CVT_EMF );
+sMediaType = image/x-emf;
+pExtension = .emf;
+}
+
+if (bSwapped)
+const_castGraphic(rGraphic).SwapOut();
 } else {
 OSL_TRACE( unhandled graphic type );
 /*Earlier, even in case of unhandled graphic types we were
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 65cc919..68e4e07 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -56,6 +56,8 @@ sal_uLong GraphicConverter::Import( SvStream rIStm, Graphic 
rGraphic, sal_uLon
 
 sal_uLong GraphicConverter::Export( SvStream rOStm, const Graphic rGraphic, 
sal_uLong nFormat )
 {
+SAL_WARN_IF(rGraphic.IsSwapOut(), vcl.filter, exporting a swapped out 
graphic!);
+
 GraphicConverter*   pCvt = ImplGetSVData()-maGDIData.mpGrfConverter;
 sal_uLong   nRet = ERRCODE_IO_GENERAL;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-09 Thread Kohei Yoshida
 oox/source/drawingml/chart/axisconverter.cxx   |8 +---
 oox/source/drawingml/chart/objectformatter.cxx |8 +++-
 oox/source/token/properties.txt|1 +
 3 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit 5d91431f2bd772cf4658a39faace7dd390208d64
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Jul 7 13:26:23 2014 -0400

Adjust for the splitting of number format properties in chart.

Since 1d38cb365543924f9c50014e6b2227e77de1d0c9, number format and
link number format to source properties are 2 separate properties.  Adjust
OOXML import code for that split.

Also, always set axis' number format via NumberFormat property even when 
it's
a percent format.  The axis object doesn't keep a non-percent and percent
number formats separately.

Change-Id: I8667b6f1a78d88cc37d059518919ad1b37f154e1
(cherry picked from commit af5a6615dfdbe5c2cacdcacb00fc6f418b925c06)
Reviewed-on: https://gerrit.libreoffice.org/10123
Reviewed-by: Matúš Kukan matus.ku...@collabora.com
Tested-by: Matúš Kukan matus.ku...@collabora.com

diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index 6767c3e..a15c23e 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -307,13 +307,7 @@ void AxisConverter::convertFromModel( const Reference 
XCoordinateSystem  rxCo
 // number format --
 
 if( (aScaleData.AxisType == cssc2::AxisType::REALNUMBER) || 
(aScaleData.AxisType == cssc2::AxisType::PERCENT) )
-{
-bool bPercent = false;
-if( mrModel.maNumberFormat.maFormatCode.indexOf('%') = 0)
-bPercent = true;
-mrModel.maNumberFormat.mbSourceLinked = false;
-getFormatter().convertNumberFormat( aAxisProp, 
mrModel.maNumberFormat, bPercent );
-}
+getFormatter().convertNumberFormat(aAxisProp, 
mrModel.maNumberFormat, false);
 
 // position of crossing axis --
 
diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index 54ef18a..d406ce9 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1133,11 +1133,7 @@ void ObjectFormatter::convertNumberFormat( PropertySet 
rPropSet, const NumberFo
 if( mxData-mxNumFmts.is() )
 {
 sal_Int32 nPropId = bPercentFormat ? PROP_PercentageNumberFormat : 
PROP_NumberFormat;
-if( rNumberFormat.mbSourceLinked || 
rNumberFormat.maFormatCode.isEmpty() )
-{
-rPropSet.setAnyProperty( nPropId, Any() );
-}
-else try
+try
 {
 sal_Int32 nIndex = 
rNumberFormat.maFormatCode.equalsIgnoreAsciiCase(general) ?
 mxData-mxNumTypes-getStandardIndex( mxData-maFromLocale ) :
@@ -1150,6 +1146,8 @@ void ObjectFormatter::convertNumberFormat( PropertySet 
rPropSet, const NumberFo
 OSL_FAIL( OStringBuffer( ObjectFormatter::convertNumberFormat - 
cannot create number format ' ).
 append( OUStringToOString( rNumberFormat.maFormatCode, 
osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() );
 }
+
+rPropSet.setProperty(PROP_LinkNumberFormatToSource, 
makeAny(rNumberFormat.mbSourceLinked));
 }
 }
 
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 0ad6d7a..44c7597 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -298,6 +298,7 @@ LineStartWidth
 LineStyle
 LineTransparence
 LineWidth
+LinkNumberFormatToSource
 LinkURL
 LoadReadonly
 LookUpLabels
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-07-03 Thread Kohei Yoshida
 oox/source/drawingml/chart/seriesconverter.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 7ba14f3fa86d1a5fbb04ca35dcb2fd1439a4223e
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Jul 1 15:10:19 2014 -0400

bnc#812796: Don't create data series when the series has no values.

Change-Id: I92e2d7a3fab0948aea0557cf3cb65d57d48f3f59
(cherry picked from commit 5e2b7e37a29edf45f829ccee2302a942b54568a1)
Reviewed-on: https://gerrit.libreoffice.org/10039
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index 292e8a4..bc27b35 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -544,6 +544,10 @@ Reference XDataSeries  
SeriesConverter::createDataSeries( const TypeGroupConve
 Reference XDataSequence  xValues = xYValueSeq-getValues();
 if( xValues.is() )
 nDataPointCount = xValues-getData().getLength();
+
+if (!nDataPointCount)
+// No values present.  Don't create a data series.
+return ReferenceXDataSeries();
 }
 // add X values of scatter and bubble charts
 if( !rTypeInfo.mbCategoryAxis )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sax/source

2014-07-01 Thread Kohei Yoshida
 oox/source/core/xmlfilterbase.cxx|6 +-
 sax/source/fastparser/fastparser.cxx |3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit d074c2ada185eb849683a96348a66adb6478a778
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Jun 30 20:03:28 2014 -0400

Use a new fast parser instance for each XML fragment.

Otherwise a crash ensues when the threaded XML parsing kicks in.

Change-Id: Ic41e5a29bbb860d7b63b70f2f0d8896264d9d53e
(cherry picked from commit dc93074f71f91efd8a615ad8f1a5289deb210b75)
Reviewed-on: https://gerrit.libreoffice.org/10002
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 746ba2e..3b807df 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -171,6 +171,7 @@ struct XmlFilterBaseImpl
 {
 typedef RefMap OUString, Relations  RelationsMap;
 
+ReferenceXComponentContext   mxContext;
 FastParser maFastParser;
 const OUString maBinSuffix;
 const OUString maVmlSuffix;
@@ -182,6 +183,7 @@ struct XmlFilterBaseImpl
 };
 
 XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference XComponentContext  
rxContext ) throw( RuntimeException ) :
+mxContext(rxContext),
 maFastParser( rxContext ),
 maBinSuffix( .bin ),
 maVmlSuffix( .vml )
@@ -274,7 +276,9 @@ OUString 
XmlFilterBase::getFragmentPathFromFirstTypeFromOfficeDoc( const OUStrin
 
 bool XmlFilterBase::importFragment( const rtl::ReferenceFragmentHandler 
rxHandler )
 {
-return importFragment(rxHandler, mxImpl-maFastParser);
+FastParser aParser(mxImpl-mxContext);
+registerNamespaces(aParser);
+return importFragment(rxHandler, aParser);
 }
 
 bool XmlFilterBase::importFragment( const rtl::ReferenceFragmentHandler 
rxHandler, FastParser rParser )
diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 82378b1..17e0213 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -979,6 +979,9 @@ void FastSaxParserImpl::produce( CallbackType aType )
 
 bool FastSaxParserImpl::hasNamespaceURL( const OUString rPrefix ) const
 {
+if (maEntities.empty())
+return false;
+
 const Entity rEntity = getEntity();
 
 if (rEntity.maNamespaceCount.empty())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-06-23 Thread Markus Mohrhard
 oox/source/drawingml/chart/chartspacefragment.cxx |3 +--
 oox/source/drawingml/chart/chartspacemodel.cxx|2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit e07eedd38062edfbe4998946b75f1a3d958e9615
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Sun Jun 22 04:47:36 2014 +0200

use the correct default value, fdo#78080

Change-Id: I8b01bf22e8e3b98ef013b947f617905d558d3554
Reviewed-on: https://gerrit.libreoffice.org/9849
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx 
b/oox/source/drawingml/chart/chartspacefragment.cxx
index 6e19f77..eec0f1c 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -85,8 +85,7 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( 
sal_Int32 nElement, const
 switch( nElement )
 {
 case C_TOKEN( autoTitleDeleted ):
-// default is 'false', not 'true' as specified
-mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, false 
);
+mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, true );
 return 0;
 case C_TOKEN( backWall ):
 return new WallFloorContext( *this, 
mrModel.mxBackWall.create() );
diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx 
b/oox/source/drawingml/chart/chartspacemodel.cxx
index cf71f14..d6e920d 100644
--- a/oox/source/drawingml/chart/chartspacemodel.cxx
+++ b/oox/source/drawingml/chart/chartspacemodel.cxx
@@ -28,7 +28,7 @@ namespace chart {
 ChartSpaceModel::ChartSpaceModel() :
 mnDispBlanksAs( XML_gap ),  // not zero as specified
 mnStyle( 2 ),
-mbAutoTitleDel( false ),
+mbAutoTitleDel( true ),
 mbPlotVisOnly( false ),
 mbShowLabelsOverMax( false ),
 mbPivotChart( false )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

2014-06-11 Thread Zolnai Tamás
 dev/null|binary
 oox/source/drawingml/textbodyproperties.cxx |6 +--
 oox/source/drawingml/transform2dcontext.cxx |   56 +++-
 sd/qa/unit/data/pptx/bnc862510_5.pptx   |binary
 sd/qa/unit/import-tests.cxx |   44 +++---
 5 files changed, 57 insertions(+), 49 deletions(-)

New commits:
commit f817dac57c748dd156cd9bacf8368dd561de88d4
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue Jun 10 18:19:30 2014 +0200

Related bnc#862510: extend handling of txXfrm

We don't actually need to check mbAnchorCtr to change
text spacing. This txXfrm workaround works only with rectangles,
because other shapes' text area can be smaller then the shape
size. So add some condition to avoid using it for
other shapes.

Plus fix typos cause regression introduced in:
53c376d35b7223d53e8c9403390afe53d1f69089

Change-Id: I87917b8e0b2bb97ae1bba773e7dda7f81682736f
(cherry picked from commit 98dd0f2bb5801f974374ef341037e094e4275cbb)

diff --git a/oox/source/drawingml/textbodyproperties.cxx 
b/oox/source/drawingml/textbodyproperties.cxx
index 9899fbb..dfa3d60 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -81,9 +81,9 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 
nRotation )
 // Hack for n#760986
 // TODO: Preferred method would be to have a textbox on top
 // of the shape and the place it according to the (off,ext)
-if( nOff == 0  moTextOffLeft  mbAnchorCtr ) nVal = *moTextOffLeft;
-if( nOff == 1  moTextOffUpper ) nVal = *moTextOffLeft;
-if( nOff == 2  moTextOffRight  mbAnchorCtr ) nVal = 
*moTextOffRight;
+if( nOff == 0  moTextOffLeft  ) nVal = *moTextOffLeft;
+if( nOff == 1  moTextOffUpper ) nVal = *moTextOffUpper;
+if( nOff == 2  moTextOffRight ) nVal = *moTextOffRight;
 if( nOff == 3  moTextOffLower ) nVal = *moTextOffLower;
 if( nVal  0 ) nVal = 0;
 
diff --git a/oox/source/drawingml/transform2dcontext.cxx 
b/oox/source/drawingml/transform2dcontext.cxx
index c036b50..d3f7f5e 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -55,37 +55,43 @@ ContextHandlerRef Transform2DContext::onCreateContext( 
sal_Int32 aElementToken,
 {
 if( mbtxXfrm )
 {
-switch( aElementToken )
+// Workaround: only for rectangles
+const sal_Int32 nType = 
mrShape.getCustomShapeProperties()-getShapePresetType();
+if( nType == XML_rect || nType == XML_roundRect )
 {
-case A_TOKEN( off ):
-{
-OUString sXValue = rAttribs.getString( XML_x ).get();
-OUString sYValue = rAttribs.getString( XML_y ).get();
-if( !sXValue.isEmpty() )
-
mrShape.getTextBody()-getTextProperties().moTextOffUpper = GetCoordinate( 
sXValue.toInt32() - mrShape.getPosition().X );
-if( !sYValue.isEmpty() )
-
mrShape.getTextBody()-getTextProperties().moTextOffLeft = GetCoordinate( 
sYValue.toInt32() - mrShape.getPosition().Y );
-}
-break;
-case A_TOKEN( ext ):
-{
-const OUString sXValue = rAttribs.getString( XML_cx 
).get();
-const OUString sYValue = rAttribs.getString( XML_cy 
).get();
-if( !sXValue.isEmpty() )
+switch( aElementToken )
+{
+case A_TOKEN( off ):
 {
-
mrShape.getTextBody()-getTextProperties().moTextOffRight = 
GetCoordinate(mrShape.getSize().Width - sXValue.toInt32());
-if( 
mrShape.getTextBody()-getTextProperties().moTextOffLeft )
-   
*mrShape.getTextBody()-getTextProperties().moTextOffRight -=  
*mrShape.getTextBody()-getTextProperties().moTextOffLeft;
+const OUString sXValue = rAttribs.getString( XML_x 
).get();
+const OUString sYValue = rAttribs.getString( XML_y 
).get();
+if( !sXValue.isEmpty()  nType == XML_rect )
+
mrShape.getTextBody()-getTextProperties().moTextOffLeft = GetCoordinate( 
sXValue.toInt32() - mrShape.getPosition().X );
+if( !sYValue.isEmpty() )
+
mrShape.getTextBody()-getTextProperties().moTextOffUpper = GetCoordinate( 
sYValue.toInt32() - mrShape.getPosition().Y );
 }
-if( !sYValue.isEmpty() )
+break;
+case A_TOKEN( ext ):
 {
-
mrShape.getTextBody()-getTextProperties().moTextOffLower = 
GetCoordinate(mrShape.getSize().Height - sYValue.toInt32());
- 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-06-08 Thread Miklos Vajna
 oox/source/drawingml/textbodycontext.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit a14daabc24cd1a40815dc76f799c11b7796971e8
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri May 23 09:30:26 2014 +0200

DOCX import: recurse into w:ins in groupshape text

Groupshape text is provided by editeng, redlining is available in Writer
text only. But still, instead of ignoring both deletions and insertions
in group shape text, we could at least show the latest version
correctly, i.e. ignore deletions but import insertions.

Change-Id: I12df2ca1a8d27f9496a8036e521f8820d7075053
(cherry picked from commit e6300f83d08fd959596551dcd660eb0fbfb248a6)

diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index 9821149..5d9bd6a 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -90,6 +90,13 @@ ContextHandlerRef TextParagraphContext::onCreateContext( 
sal_Int32 aElementToken
 case OOX_TOKEN( doc, sdt ):
 case OOX_TOKEN( doc, sdtContent ):
 return this;
+case OOX_TOKEN( doc, del ):
+break;
+case OOX_TOKEN( doc, ins ):
+return this;
+break;
+default:
+SAL_WARN(oox, TextParagraphContext::onCreateContext: unhandled 
element:   getBaseToken(aElementToken));
 }
 
 return 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-06-06 Thread Markus Mohrhard
 oox/source/drawingml/shape.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bd096081eb56a70cd6f65e5c957fa73cd5193f1d
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Sat Jun 7 03:43:47 2014 +0200

make sure all objects exist, related fdo#75692

fdo75692-2.xlsx and fdo#75692-3.xlsx crash.

Change-Id: I56353e7da1850a49e18d3a570641843600d34b1c

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8c97b87..0737830 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1249,7 +1249,8 @@ void Shape::finalizeXShape( XmlFilterBase rFilter, const 
Reference XShapes 
 {
 Reference chart2::data::XDataReceiver  xDataRec( 
xChartDoc, UNO_QUERY );
 Reference chart2::data::XDataSource  xData( 
xDataRec-getUsedData(), UNO_QUERY );
-if( xData-getDataSequences().getLength() = 0 || 
xData-getDataSequences()[0]-getValues()-getData().getLength() = 0 )
+if( xData-getDataSequences().getLength() = 0 || 
!xData-getDataSequences()[0]-getValues().is() ||
+
xData-getDataSequences()[0]-getValues()-getData().getLength() = 0 )
 {
 rFilter.useInternalChartDataTable( true );
 rFilter.getChartConverter()-convertFromModel( 
rFilter, aModel, xChartDoc, xExternalPage, mxShape-getPosition(), 
mxShape-getSize() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-06-05 Thread Michael Meeks
 oox/source/export/vmlexport.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 591e10c106d9672559672f43346cf000f3a734b3
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Jun 3 22:55:05 2014 +0100

Be more sensible about checking buffers of VML points we write.

Change-Id: Id3811dbe0cf2510ef6a851804b3886c14eca01b6
(cherry picked from commit a2d2c7f707838511ede017ed920205b9165a35a2)

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 0f3038b..f315766 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -519,6 +519,14 @@ void VMLExport::Commit( EscherPropertyContainer rProps, 
const Rectangle rRect
 break;
 default:
 // See 
EscherPropertyContainer::CreateCustomShapeProperties, by default nSeg is simply 
the number of points.
+// FIXME: we miss out a significant amount 
of complexity from
+// the above method here, and do some 
rather odd things to match.
+int nElems = aVertices.nPropSize / ( 
nPointSize * 2);
+if (nSeg  nElems)
+{
+SAL_WARN(oox, Busted escher export 
  nSeg  vs .   nElems   truncating point stream);
+nSeg = nElems;
+}
 for (int i = 0; i  nSeg; ++i)
 {
 sal_Int32 nX = 
impl_GetPointComponent(pVerticesIt, nPointSize);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-05-25 Thread Julien Nabet
 oox/source/vml/vmlinputstream.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 38365bf44e7ea37d25463787baab83e985240a41
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat May 24 16:35:49 2014 +0200

Resolves: fdo#79137 Crash in oox::vml::InputStream::updateBuffer

bt shows:
Program received signal SIGSEGV, Segmentation fault.
0x2aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) 
at 
/home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339
339 while( (mnBufferPos = maBuffer.getLength())  
!mxTextStrm-isEOF() )
(gdb) bt
0x2aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) 
at 
/home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339
0x2aaadba21048 in oox::vml::InputStream::available (this=0x8d7fd80) at 
/home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:326
0x2aaacf5a0249 in sax_fastparser::FastSaxParserImpl::parseStream 
(this=0x89aea30, maStructSource=...)
at 
/home/julien/compile-libreoffice/libreoffice/sax/source/fastparser/fastparser.cxx:810

Indeed, mxTextStrm is invalid, so let's test its validity in InputStream 
constructor

Cherry-picked from 372d5d74ad8cfb9b69dc20557359c4a2c1597b57

Change-Id: Ifed79603e33b64d11eb07656df17824b7f98058f
Reviewed-on: https://gerrit.libreoffice.org/9465
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/vml/vmlinputstream.cxx 
b/oox/source/vml/vmlinputstream.cxx
index 70896e1..f373bad0 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -266,6 +266,8 @@ InputStream::InputStream( const Reference 
XComponentContext  rxContext, const
 maClosingCData( CREATE_OSTRING( ]] ) ),
 mnBufferPos( 0 )
 {
+if (!mxTextStrm.is())
+throw IOException();
 maOpeningBracket[ 0 ] = '';
 maClosingBracket[ 0 ] = '';
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

2014-05-22 Thread Miklos Vajna
 oox/source/core/xmlfilterbase.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b5e0ea4ae944482f43de447668758348ce0251c4
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu May 22 10:22:43 2014 +0200

oox: fix export of OOXML generator info

This time we did preserve this info, and we should not.

Change-Id: If2ddd7a266cd7da5642dc234411ce34e94bd3384
(cherry picked from commit 3bebb3c2d25601767e950de02f2d549acbdaa2d2)

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 14d50fc..746ba2e 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -28,6 +28,7 @@
 #include com/sun/star/xml/sax/XFastSAXSerializable.hpp
 #include com/sun/star/document/XDocumentProperties.hpp
 #include unotools/mediadescriptor.hxx
+#include unotools/docinfohelper.hxx
 #include sax/fshelper.hxx
 #include rtl/strbuf.hxx
 #include rtl/ustrbuf.hxx
@@ -658,7 +659,7 @@ writeAppProperties( XmlFilterBase rSelf, Reference 
XDocumentProperties  xProp
 writeElement( pAppProps, XML_HyperlinksChanged, hyperlinks changed );
 writeElement( pAppProps, XML_DigSig,digital signature );
 #endif  /* def OOXTODO */
-writeElement( pAppProps, XML_Application,   
xProperties-getGenerator() );
+writeElement( pAppProps, XML_Application,   
utl::DocInfoHelper::GetGeneratorString() );
 #ifdef OOXTODO
 writeElement( pAppProps, XML_AppVersion,app version );
 writeElement( pAppProps, XML_DocSecurity,   doc security );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits