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

2014-09-30 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 f5c7ce25cec1a01a1f154c180d46fc97b32a2105
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
(cherry picked from commit c84ce79132c674b4c2d31da8997ed77671323dfe)
Reviewed-on: https://gerrit.libreoffice.org/11727
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx 
b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 2953660..2a196d5 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -400,7 +400,15 @@ bool LayoutNode::setupShape( const ShapePtr rShape, const 
Diagram rDgm, sal_uI
 const 
DiagramData::StringMap::value_type::second_type::const_iterator 
aVecEnd=aNodeName-second.end();
 while( aVecIter != aVecEnd )
 {
-DiagramData::PointNameMap::const_iterator 
aDataNode2=rDgm.getData()-getPointNameMap().find(aVecIter-first);
+DiagramData::PointNameMap rMap = 
rDgm.getData()-getPointNameMap();
+DiagramData::PointNameMap::const_iterator aDataNode2 = 
rMap.find(aVecIter-first);
+if (aDataNode2 == rMap.end())
+{
+//busted, skip it
+++aVecIter;
+continue;
+}
+
 if( aVecIter-second == 0 )
 {
 // grab shape attr from topmost element(s)
diff --git a/sw/qa/core/data/ooxml/pass/fdo79129.docx 
b/sw/qa/core/data/ooxml/pass/fdo79129.docx
new file mode 100644
index 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-2' - oox/source sd/qa

2014-09-30 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 4fca0fcd7801091d0469525821231dc319a23811
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue Sep 30 19:55:50 2014 +0200

bnc#584721: invisible text because of wrong color (white)

Color::getColor() method uses some caching mechanism which
works wrong when the result depend on one of the input parameters.
So avoid caching in these cases.

(cherry picked from commit cfe658c289de030dc3a8fecd3bac0a0004a18061)

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

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

diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 52d5465..ec084cc 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -342,13 +342,10 @@ void Color::clearTransparence()
 
 sal_Int32 Color::getColor( const GraphicHelper rGraphicHelper, sal_Int32 
nPhClr ) const
 {
-/*  Special handling for theme style list placeholder colors (state
-COLOR_PH), Color::getColor() may be called with different placeholder
-colors in the nPhClr parameter. Therefore, the resolved color will not
-be stored in this object, thus the state COLOR_FINAL will not be
-reached and the transformation container will not be cleared, but the
-original COLOR_PH state will be restored instead. */
-bool bIsPh = false;
+const sal_Int32 nTempC1 = mnC1;
+const sal_Int32 nTempC2 = mnC2;
+const sal_Int32 nTempC3 = mnC3;
+const ColorMode eTempMode = meMode;
 
 switch( meMode )
 {
@@ -361,7 +358,7 @@ sal_Int32 Color::getColor( const GraphicHelper 
rGraphicHelper, sal_Int32 nPhClr
 case COLOR_SCHEME:  setResolvedRgb( rGraphicHelper.getSchemeColor( 
mnC1 ) );break;
 case COLOR_PALETTE: setResolvedRgb( rGraphicHelper.getPaletteColor( 
mnC1 ) );   break;
 case COLOR_SYSTEM:  setResolvedRgb( rGraphicHelper.getSystemColor( 
mnC1, mnC2 ) );  break;
-case COLOR_PH:  setResolvedRgb( nPhClr ); bIsPh = true;
 break;
+case COLOR_PH:  setResolvedRgb( nPhClr );  
 break;
 
 case COLOR_FINAL:   return mnC1;
 }
@@ -497,10 +494,23 @@ sal_Int32 Color::getColor( const GraphicHelper 
rGraphicHelper, sal_Int32 nPhClr
 mnC1 = API_RGB_TRANSPARENT;
 }
 
-meMode = bIsPh ? COLOR_PH : COLOR_FINAL;
+sal_Int32 nRet = mnC1;
+// Restore the original values when the color depends on one of the input
+// parameters (rGraphicHelper or nPhClr)
+if( eTempMode = COLOR_SCHEME  eTempMode = COLOR_PH )
+{
+mnC1 = nTempC1;
+mnC2 = nTempC2;
+mnC3 = nTempC3;
+meMode = eTempMode;
+}
+else
+{
+meMode = COLOR_FINAL;
+}
 if( meMode == COLOR_FINAL )
 maTransforms.clear();
-return mnC1;
+return nRet;
 }
 
 bool Color::hasTransparency() const
diff --git a/sd/qa/unit/data/pptx/bnc584721_4.pptx 
b/sd/qa/unit/data/pptx/bnc584721_4.pptx
new file mode 100644
index 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 d931c10..df848de 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -69,6 +69,7 @@ public:
 void testBnc862510_5();
 void testBnc480256();
 void testCreationDate();
+void testBnc584721_4();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -87,6 +88,7 @@ public:
 CPPUNIT_TEST(testBnc862510_5);
 CPPUNIT_TEST(testBnc480256);
 CPPUNIT_TEST(testCreationDate);
+CPPUNIT_TEST(testBnc584721_4);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -692,6 +694,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-2' - 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 599e5096ba7bde1c88120376b12f3f691847f17d
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)

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 583d7aa..baf49a6 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -84,15 +84,26 @@ void applyLineAttributes( const ::oox::core::XmlFilterBase 
rFilterBase,
 aPropSet.setProperty( nPropId, aBorderLine );
 }
 
-void applyBorder( TableStylePart rTableStylePart, sal_Int32 nLineType, 
oox::drawingml::LineProperties rLineProperties )
+void applyBorder( const ::oox::core::XmlFilterBase rFilterBase, 
TableStylePart rTableStylePart, sal_Int32 nLineType, 
oox::drawingml::LineProperties rLineProperties )
 {
 std::map  sal_Int32, ::oox::drawingml::LinePropertiesPtr  
rPartLineBorders( rTableStylePart.getLineBorders() );
+::oox::drawingml::ShapeStyleRef rLineStyleRef = 
rTableStylePart.getStyleRefs()[ nLineType ];
 std::map  sal_Int32, ::oox::drawingml::LinePropertiesPtr 
::const_iterator aIter( rPartLineBorders.find( nLineType ) );
 if ( ( aIter != rPartLineBorders.end() )  aIter-second.get() )
 rLineProperties.assignUsed( *aIter-second );
+else if (rLineStyleRef.mnThemedIdx != 0)
+{
+if (const Theme* pTheme = rFilterBase.getCurrentTheme())
+{
+rLineProperties.assignUsed( 
*pTheme-getLineStyle(rLineStyleRef.mnThemedIdx) );
+sal_Int32 nPhClr = rLineStyleRef.maPhClr.getColor( 
rFilterBase.getGraphicHelper() );
+rLineProperties.maLineFill.maFillColor.setSrgbClr( nPhClr );
+}
+}
 }
 
-void applyTableStylePart( oox::drawingml::FillProperties rFillProperties,
+void applyTableStylePart( const ::oox::core::XmlFilterBase rFilterBase,
+  oox::drawingml::FillProperties rFillProperties,
   TextCharacterProperties aTextCharProps,
   oox::drawingml::LineProperties rLeftBorder,
   oox::drawingml::LineProperties rRightBorder,
@@ -106,12 +117,12 @@ void applyTableStylePart( oox::drawingml::FillProperties 
rFillProperties,
 if ( rPartFillPropertiesPtr.get() )
 rFillProperties.assignUsed( *rPartFillPropertiesPtr );
 
-applyBorder( rTableStylePart, XML_left, rLeftBorder );
-applyBorder( rTableStylePart, XML_right, rRightBorder );
-applyBorder( rTableStylePart, XML_top, rTopBorder );
-applyBorder( rTableStylePart, XML_bottom, rBottomBorder );
-applyBorder( rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
-applyBorder( rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_tl2br, 
rTopLeftToBottomRightBorder );
+applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, 
rBottomLeftToTopRightBorder );
 
 aTextCharProps.maLatinFont = rTableStylePart.getLatinFont();
 aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
@@ -171,7 +182,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase rFilterBase, ::oo
 oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight;
 oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight;
 
-applyTableStylePart( aFillProperties, aTextStyleProps,
+applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
 aLinePropertiesLeft,
 aLinePropertiesRight,
 aLinePropertiesTop,
@@ -182,7 +193,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase rFilterBase, ::oo
 
 if ( rProperties.isFirstRow()  ( nRow == 0 ) )
 {
-applyTableStylePart( aFillProperties, aTextStyleProps,
+applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps,
 aLinePropertiesLeft,
 aLinePropertiesRight,
 aLinePropertiesTop,
@@ -193,7 +204,7 @@ void TableCell::pushToXCell( const 
::oox::core::XmlFilterBase rFilterBase, ::oo
 }
 if ( rProperties.isLastRow()  ( nRow == nMaxRow ) )
 {
-applyTableStylePart( aFillProperties, aTextStyleProps,
+

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

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

New commits:
commit 23a817342f264bde5b6d4cb6b00b298c7b930430
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/11468
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 cd4e75d..1813af4 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-2' - oox/source

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

New commits:
commit b51e8ee475832e20901d6dafb40b28c44582a3f3
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/11180
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 847d21c..aa7735f 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1063,7 +1063,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;
@@ -1125,6 +1125,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-2' - 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 c46620ffd96638377018e6da0d31c46c4b4d3016
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)
Signed-off-by: Andras Timar andras.ti...@collabora.com

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

Change-Id: I0b74ac91aee7b8b3e0bc763247086a3a39816bc1

diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index d294b79..259e716 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -77,6 +77,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 f4f4f08..7920e0e 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -27,7 +27,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
@@ -63,6 +65,7 @@ public:
 void testBnc870233_2();
 void testBnc880763();
 void testBnc862510_5();
+void testCreationDate();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -79,6 +82,7 @@ public:
 CPPUNIT_TEST(testBnc870233_2);
 CPPUNIT_TEST(testBnc880763);
 CPPUNIT_TEST(testBnc862510_5);
+CPPUNIT_TEST(testCreationDate);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -434,6 +438,18 @@ void SdFiltersTest::testBnc870237()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testCreationDate()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/n593612.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(2008-12-10T19:12:35), 
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-2' - oox/source

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

New commits:
commit ca51beb73336b3a19364df02aab82d56a2a63e74
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.

(cherry picked from commit d068f13596f6d1023a70d98ec2059d38ad6fd777)

Change-Id: I201ec8dbcddca56d21bf46ea8ee838d01923c442
Reviewed-on: https://gerrit.libreoffice.org/10585
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 b580be3..166ecd0 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -132,7 +132,11 @@ ContextHandlerRef 
TextBodyPropertiesContext::onCreateContext( sal_Int32 aElement
 mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] = 
false;
 break;
 case A_TOKEN( spAutoFit ):
-mrTextBodyProp.maPropertyMap[ 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[ 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-2' - oox/source

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

New commits:
commit 41ed9c8e761b69987c978d41fd89aa1a169f60dd
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.

(cherry picked from commit d60cec0e60c5c0880f8098d39443c391abed80b2)

Change-Id: I55e66aeaa7176fbd3f64dcdf075d411f460947d4
Reviewed-on: https://gerrit.libreoffice.org/10514
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 7bb719a..79c1664 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[ PROP_BulletColor ] = 
(*maRuns.begin())-getTextCharacterProperties().maCharColor.getColor( 
rFilterBase.getGraphicHelper() );
+if( !aioBulletList.hasProperty( PROP_BulletColor )  
aTextCharacterStyle.maCharColor.isUsed() )
+aioBulletList[ PROP_BulletColor ] = 
aTextCharacterStyle.maCharColor.getColor( rFilterBase.getGraphicHelper() );
 
 float fCharacterSize = nCharHeight  0 ? GetFontHeight ( 
nCharHeight ) : pTextParagraphStyle-getCharHeightPoints( 18 );
 aParaProp.pushToPropSet( rFilterBase, xProps, aioBulletList, 
pTextParagraphStyle-getBulletList(), sal_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-2' - oox/source

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

New commits:
commit 6786bb6571c2d84cdfb2c09ff739c512459e4367
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/10383
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 c4648c2..6c5259e 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -140,8 +140,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-2' - oox/source

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

New commits:
commit 008f5ba99fd89cd6a6e4db90e8db16e02fe0b027
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/10382
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 a5eb026..a81a5d2 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;
@@ -567,7 +568,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-2' - 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 ed4cbd4f6726dcae80bf8b42bee97e5bcf465502
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/10329
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 74b0b91..43e4b1f 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-2' - 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 087eb8031b444d62a10d744e7b5983f97c59883c
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/10330
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 c3c4f49..1bb6241 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-2' - 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 b0282d868b418b4ecdb19cbb633c9399ac84161b
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/10300
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 dd6605b..847d21c 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -495,14 +495,32 @@ OUString DrawingML::WriteImage( const Graphic rGraphic )
 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 );
 break;
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 02ca288..d395670 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -57,6 +57,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-2' - 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 c14063522433306c9b7f598b623d54fefd2a443d
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/10003
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 cf996eb..1608aed 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -158,6 +158,7 @@ struct XmlFilterBaseImpl
 {
 typedef RefMap OUString, Relations  RelationsMap;
 
+ReferenceXComponentContext   mxContext;
 FastParser maFastParser;
 const OUString maBinSuffix;
 const OUString maVmlSuffix;
@@ -170,6 +171,7 @@ struct XmlFilterBaseImpl
 
 
 XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference XComponentContext  
rxContext ) throw( RuntimeException ) :
+mxContext(rxContext),
 maFastParser( rxContext ),
 maBinSuffix( .bin ),
 maVmlSuffix( .vml )
@@ -268,7 +270,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 4ddbd2a..e10ce3f 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1042,6 +1042,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-2' - oox/source

2014-06-26 Thread Muthu Subramanian
 oox/source/drawingml/textcharacterproperties.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ad9a48a2b31fc97bcfbf50b8f5731f520c281595
Author: Muthu Subramanian sumu...@collabora.com
Date:   Thu Dec 12 18:24:42 2013 +0530

n#828390: Reset charescapement.

Unless the value is reset - the escapement
seems to continue to the next set of textruns.

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

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index a7be42b..8364c86 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -122,6 +122,9 @@ void TextCharacterProperties::pushToPropMap( PropertyMap 
rPropMap, const XmlFil
 if( moBaseline.has() ) {
 rPropMap[ PROP_CharEscapement ] = sal_Int16(moBaseline.get( 0 ) / 
1000);
 rPropMap[ PROP_CharEscapementHeight ] = sal_Int8(DFLT_ESC_PROP);
+} else {
+rPropMap[ PROP_CharEscapement ] = sal_Int16(0);
+rPropMap[ PROP_CharEscapementHeight ] = sal_Int8(100); // 100%
 }
 
 if( !bUseOptional || moBold.has() ) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-12 Thread Zolnai Tamás
 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 |   23 +++
 4 files changed, 57 insertions(+), 28 deletions(-)

New commits:
commit b56c4afb219c3ad2507af9d4eadf0c765c3bc0e0
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

(cherry picked from commit 98dd0f2bb5801f974374ef341037e094e4275cbb)

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

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

diff --git a/oox/source/drawingml/textbodyproperties.cxx 
b/oox/source/drawingml/textbodyproperties.cxx
index 3861ebe..93a2f5f 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -80,9 +80,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 92166c4..0064780 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 ):
 {
-  

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

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

New commits:
commit 5a1a182f626bd9caa077e20850a132759fec5d86
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/9466
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 48d0a3c..34336a5 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-2' - oox/source

2014-05-21 Thread Muthu Subramanian
 oox/source/drawingml/textcharacterpropertiescontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b8f4cacb4b8c5a9d7d05fe4979e048e237ed4426
Author: Muthu Subramanian sumu...@collabora.com
Date:   Fri Mar 14 15:31:53 2014 +0530

n#862510: Ignore baseline attributes with zero.

Change-Id: I1adc46e62c82c23645ccad0e11d5a7cb07114539
(cherry picked from commit 19abfaffe74b925e4428943d14187a7008797982)
Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx 
b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 6887cda..8217cac 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -52,7 +52,7 @@ 
TextCharacterPropertiesContext::TextCharacterPropertiesContext(
 mrTextCharacterProperties.moUnderline = rAttribs.getToken( XML_u );
 if ( rAttribs.hasAttribute( XML_strike ) )
 mrTextCharacterProperties.moStrikeout = rAttribs.getToken( XML_strike 
);
-if ( rAttribs.hasAttribute( XML_baseline ) )
+if ( rAttribs.hasAttribute( XML_baseline )  rAttribs.getInteger( 
XML_baseline ).get() != 0 )
 mrTextCharacterProperties.moBaseline = rAttribs.getInteger( 
XML_baseline );
 
 if ( rAttribs.hasAttribute( XML_b ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-16 Thread Tor Lillqvist
 oox/source/drawingml/shape.cxx |   26 ++
 1 file changed, 10 insertions(+), 16 deletions(-)

New commits:
commit 456d5d928ebfd333b3169d69806d50303cebb6bf
Author: Tor Lillqvist t...@collabora.com
Date:   Fri May 16 16:43:25 2014 +0300

Use SVM (metafile) instead of PNG for diagrams (SmartArt)

It seemed a bit pointless to waste CPU cycles on PNG-compressing a
bitmap image only to later then uncompress it anyway. vcl's PNG
writing code showed up as 13% on the time profile of TiledLibreOffice
when displaying a document full of SmartArts.

Miklos suggested I try using SVM (which I guess means StarView
Metafile) instead. When using SVM, no rendering of diagrams to
bitmaps during loading is done, but the diagram stays stored in a
resolution-independent (vector-ish) form. Which means it will be
rendered nicely and crisply regardless of the zoom level.

At least, that is my understanding, and experimentation (on OS X and Linux)
seems to confirm.

ce8c0ff07559ddcc729bffd7a68f4c6f281882e3

Change-Id: Ice8c0ff07559ddcc729bffd7a68f4c6f281882e3
(cherry picked from commit 633003965a4be0c535b43cc3072c5c4a95109d34)
Reviewed-on: https://gerrit.libreoffice.org/9382
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 54db7bb..35bdf6c 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -717,7 +717,7 @@ Reference  XShape  Shape::renderDiagramToGraphic( 
XmlFilterBase rFilterBase )
 Reference  io::XOutputStream  xOutputStream( 
xStream-getOutputStream() );
 
 // Rendering format
-OUString sFormat( PNG );
+OUString sFormat( SVM );
 
 // Size of the rendering
 awt::Size aActualSize = mxShape-getSize();
@@ -726,21 +726,15 @@ Reference  XShape  Shape::renderDiagramToGraphic( 
XmlFilterBase rFilterBase )
 awt::Size aSize = awt::Size( static_cast  sal_Int32  ( ( 
fPixelsPer100thmm * aActualSize.Width ) + 0.5 ),
  static_cast  sal_Int32  ( ( 
fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) );
 
-Sequence PropertyValue  aFilterData( 7 );
-aFilterData[ 0 ].Name = Compression;
-aFilterData[ 0 ].Value = static_cast  sal_Int32  ( 9 );
-aFilterData[ 1 ].Name = Interlaced;
-aFilterData[ 1 ].Value = static_cast  sal_Int32  ( 1 );
-aFilterData[ 2 ].Name = Translucent;
-aFilterData[ 2 ].Value = static_cast  sal_Int32  ( 1 );
-aFilterData[ 3 ].Name = PixelWidth;
-aFilterData[ 3 ].Value = aSize.Width;
-aFilterData[ 4 ].Name = PixelHeight;
-aFilterData[ 4 ].Value = aSize.Height;
-aFilterData[ 5 ].Name = LogicalWidth;
-aFilterData[ 5 ].Value = aActualSize.Width;
-aFilterData[ 6 ].Name = LogicalHeight;
-aFilterData[ 6 ].Value = aActualSize.Height;
+Sequence PropertyValue  aFilterData( 4 );
+aFilterData[ 0 ].Name = PixelWidth;
+aFilterData[ 0 ].Value = aSize.Width;
+aFilterData[ 1 ].Name = PixelHeight;
+aFilterData[ 1 ].Value = aSize.Height;
+aFilterData[ 2 ].Name = LogicalWidth;
+aFilterData[ 2 ].Value = aActualSize.Width;
+aFilterData[ 3 ].Name = LogicalHeight;
+aFilterData[ 3 ].Value = aActualSize.Height;
 
 Sequence  PropertyValue  aDescriptor( 3 );
 aDescriptor[ 0 ].Name = OutputStream;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-28 Thread Muthu Subramanian
 oox/source/drawingml/transform2dcontext.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 66c01c7ba3882555642ce0c353ea3abf15bda2b5
Author: Muthu Subramanian sumu...@collabora.com
Date:   Wed Mar 26 16:05:44 2014 +0530

n#862510: Fix text rotation.

Fix breaks document in n#783433 - the one there is
damaged - resaving it using mso 2010 should fix the problem there.

Change-Id: Ib2ee7ab20489d716dc189ac6810d705763a16476
(cherry picked from commit e3e12b1d1e36e1a0d4fc4c6423b584d677693897)
Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/oox/source/drawingml/transform2dcontext.cxx 
b/oox/source/drawingml/transform2dcontext.cxx
index 8b9040c..d3a7c4b 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -46,7 +46,8 @@ Transform2DContext::Transform2DContext( 
ContextHandler2Helper rParent, const At
 }
 else
 {
-mrShape.getTextBody()-getTextProperties().moRotation = 
rAttribs.getInteger( XML_rot );
+if( rAttribs.hasAttribute( XML_rot ) )
+mrShape.getTextBody()-getTextProperties().moRotation = 
-rAttribs.getInteger( XML_rot ).get();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-28 Thread Luboš Luňák
 oox/source/export/drawingml.cxx |4 +++-
 sd/qa/unit/data/fdo71961.odp|binary
 sd/qa/unit/import-tests.cxx |   36 
 3 files changed, 39 insertions(+), 1 deletion(-)

New commits:
commit a929f282d7baa6cb73b17cae2d68d82d72008903
Author: Luboš Luňák l.lu...@collabora.com
Date:   Thu Mar 27 18:46:16 2014 +0100

write (no)wrap of text only for custom shapes to .pptx (fdo#71961)

Apparently checking the TextWordWrap property in DrawingML::WriteText()
gives false by default for objects that do not have it set, which happens
to be everything except for custom shapes, which seem to be the only ones
to actually obey it. So all normal text would be exported as nowrap to .pptx
and read back as custom shape that has non-wrapping text.

I tried to make the property return true (which is what it should be in 
practice),
but that appears to be an exercise in futility, or I'm not mad enough to 
follow
the complicated property sets and whatnot. So just write it out only for 
custom
shapes. UNO purists, if any, are welcome to change the dynamic_cast to 
something
UNO-better if they manage without an ambiguous base class error.

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

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index a8c5741..dd6605b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -69,6 +69,7 @@
 #include editeng/svxenum.hxx
 #include svx/unoapi.hxx
 #include svx/svdoashp.hxx
+#include svx/unoshape.hxx
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::beans;
@@ -1320,7 +1321,8 @@ void DrawingML::WriteText( Reference XInterface  
rXIface  )
 
 sal_Bool bHasWrap = sal_False;
 sal_Bool bWrap = sal_False;
-if( GETA( TextWordWrap ) ) {
+// Only custom shapes obey the TextWordWrap option, normal text always 
wraps.
+if( dynamic_castSvxCustomShape*(rXIface.get())  GETA( TextWordWrap ) ) 
{
 mAny = bWrap;
 bHasWrap = sal_True;
 }
diff --git a/sd/qa/unit/data/fdo71961.odp b/sd/qa/unit/data/fdo71961.odp
new file mode 100644
index 000..323fbe8
Binary files /dev/null and b/sd/qa/unit/data/fdo71961.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 23ddec3..991f5fe 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -17,6 +17,7 @@
 #include editeng/escapementitem.hxx
 
 #include svx/svdotext.hxx
+#include svx/svdoashp.hxx
 #include animations/animationnodehelper.hxx
 
 #include com/sun/star/drawing/XDrawPage.hpp
@@ -47,6 +48,7 @@ public:
 void testFdo64512();
 void testFdo71075();
 void testN828390();
+void testFdo71961();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -56,6 +58,7 @@ public:
 CPPUNIT_TEST(testFdo64512);
 CPPUNIT_TEST(testFdo71075);
 CPPUNIT_TEST(testN828390);
+CPPUNIT_TEST(testFdo71961);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -327,6 +330,39 @@ void SdFiltersTest::testFdo71075()
 CPPUNIT_ASSERT_MESSAGE( Invalid Series count, 
aValues.getConstArray()[i] == values[i]);
 }
 
+void SdFiltersTest::testFdo71961()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(getURLFromSrc(/sd/qa/unit/data/fdo71961.odp));
+CPPUNIT_ASSERT_MESSAGE( failed to load, xDocShRef.Is() );
+CPPUNIT_ASSERT_MESSAGE( not in destruction, 
!xDocShRef-IsInDestruction() );
+
+xDocShRef = saveAndReload( xDocShRef, PPTX );
+CPPUNIT_ASSERT_MESSAGE( failed to load, xDocShRef.Is() );
+CPPUNIT_ASSERT_MESSAGE( not in destruction, 
!xDocShRef-IsInDestruction() );
+
+SdDrawDocument *pDoc = xDocShRef-GetDoc();
+CPPUNIT_ASSERT_MESSAGE( no document, pDoc != NULL );
+const SdrPage *pPage = pDoc-GetPage (1);
+CPPUNIT_ASSERT_MESSAGE( no page, pPage != NULL );
+
+// Export to .pptx changes all text frames to custom shape objects, which 
obey TextWordWrap property
+// (which is false for text frames otherwise and is ignored). Check that 
frames that should wrap still do.
+SdrObjCustomShape *pTxtObj = dynamic_castSdrObjCustomShape *( 
pPage-GetObj( 1 ));
+CPPUNIT_ASSERT_MESSAGE( no text object, pTxtObj != NULL);
+CPPUNIT_ASSERT_EQUAL( OUString( Text to be always wrapped ), 
pTxtObj-GetOutlinerParaObject()-GetTextObject().GetText(0));
+CPPUNIT_ASSERT_EQUAL( true, (static_castconst 
SdrTextWordWrapItem(pTxtObj-GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
+
+pTxtObj = dynamic_castSdrObjCustomShape *( pPage-GetObj( 2 ));
+CPPUNIT_ASSERT_MESSAGE( no text object, pTxtObj != NULL);
+CPPUNIT_ASSERT_EQUAL( OUString( Custom shape non-wrapped text ), 

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

2014-03-23 Thread Tomaž Vajngerl
 oox/source/crypto/CryptTools.cxx |   44 +--
 1 file changed, 38 insertions(+), 6 deletions(-)

New commits:
commit 7cf5d562e6e86b0f571edc95a150b8dce8f3ddef
Author: Tomaž Vajngerl tomaz.vajng...@collabora.com
Date:   Sun Mar 23 14:20:10 2014 +0100

fdo#75955 use SHA1 from openssl/nss instead of rtl_digest_sha1

Change-Id: I92186b2ed8426d59e31080cfb629beb02cd01c41

diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx
index d9ba500..00be5e0 100644
--- a/oox/source/crypto/CryptTools.cxx
+++ b/oox/source/crypto/CryptTools.cxx
@@ -196,15 +196,47 @@ sal_uInt32 Encrypt::update(vectorsal_uInt8 output, 
vectorsal_uInt8 input,
 
 bool sha1(vectorsal_uInt8 output, vectorsal_uInt8 input)
 {
+bool aResult = false;
+
+#if USE_TLS_OPENSSL
 output.clear();
-output.resize(RTL_DIGEST_LENGTH_SHA1, 0);
+output.resize(SHA_DIGEST_LENGTH, 0);
+
+SHA_CTX context;
+SHA1_Init(context);
+SHA1_Update(context, input[0], input.size());
+SHA1_Final(output[0], context);
+aResult = true;
+#endif
 
-rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
-rtl_digest_update( aDigest, input[0], input.size() );
-rtl_digest_get( aDigest, output[0], RTL_DIGEST_LENGTH_SHA1 );
-rtl_digest_destroy( aDigest );
+#if USE_TLS_NSS
+output.clear();
+output.resize(SHA1_LENGTH, 0);
 
-return true;
+// Initialize NSS, database functions are not needed
+NSS_NoDB_Init(NULL);
+SECStatus status;
+
+PK11Context* mContext = PK11_CreateDigestContext(SEC_OID_SHA1);
+status = PK11_DigestBegin(mContext);
+if (status != SECSuccess)
+return false;
+
+status = PK11_DigestOp(mContext, input[0], input.size());
+if (status != SECSuccess)
+return false;
+
+unsigned int outputLength = 0;
+
+status = PK11_DigestFinal(mContext, output[0], outputLength, 
SHA1_LENGTH);
+if (status != SECSuccess || outputLength != SHA1_LENGTH)
+return false;
+
+PK11_DestroyContext(mContext, PR_TRUE);
+
+aResult = true;
+#endif
+return aResult;
 }
 
 bool sha512(vectorsal_uInt8 output, vectorsal_uInt8 input)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-16 Thread Muthu Subramanian
 oox/source/export/drawingml.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3f16ae0233442bd2b8f2f0ebde9a2741a41ef6c4
Author: Muthu Subramanian sumu...@collabora.com
Date:   Wed Dec 18 19:56:28 2013 +0530

fdo#73627 n#828390: Explictly export font properties.

Seems like the status is returned as default,
but the font properties needs to be still exported.

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

Change-Id: I65619d10f44ad54ab79874c718e47677049a2ff8

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 7526741..75bfc56 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -699,14 +699,14 @@ void DrawingML::WriteRunProperties( Reference 
XPropertySet  rRun, sal_Bool bIs
 sal_Int32 nSize = 1800;
 sal_Int32 nCharEscapement = 0;
 
-if( GETAD( CharHeight ) )
+if( GETA( CharHeight ) )
 nSize = (sal_Int32) (100*(*((float*) mAny.getValue(;
 
-if ( ( bComplex  GETAD( CharWeightComplex ) ) || GETAD( CharWeight ) )
+if ( ( bComplex  GETA( CharWeightComplex ) ) || GETA( CharWeight ) )
 if ( *((float*) mAny.getValue()) = awt::FontWeight::SEMIBOLD )
 bold = 1;
 
-if ( ( bComplex  GETAD( CharPostureComplex ) ) || GETAD( CharPosture ) )
+if ( ( bComplex  GETA( CharPostureComplex ) ) || GETA( CharPosture ) )
 switch ( *((awt::FontSlant*) mAny.getValue()) )
 {
 case awt::FontSlant_OBLIQUE :
@@ -815,7 +815,7 @@ void DrawingML::WriteRunProperties( Reference XPropertySet 
 rRun, sal_Bool bIs
 WriteSolidFill( color );
 }
 
-if( GETAD( CharFontName ) ) {
+if( GETA( CharFontName ) ) {
 const char* pitch = NULL;
 const char* charset = NULL;
 OUString usTypeface;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-16 Thread Muthu Subramanian
 oox/source/export/drawingml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f4d59251a4ef911d794c4d01edbec64310fc8676
Author: Muthu Subramanian sumu...@collabora.com
Date:   Thu Dec 19 16:48:20 2013 +0530

n#828390: Bullet sizes set wrong.

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

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 75bfc56..a8c5741 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1118,7 +1118,7 @@ void DrawingML::WriteParagraphNumbering( Reference 
XPropertySet  rXPropSet, sa
 } else {
 if( nBulletRelSize  nBulletRelSize != 100 )
 mpFS-singleElementNS( XML_a, XML_buSzPct,
-   XML_val, IS( std::min( 
(sal_Int32)25000, std::max( (sal_Int32)40, 1000*( (sal_Int32)nBulletRelSize 
) ) ) ), FSEND );
+   XML_val, IS( std::max( 
(sal_Int32)25000, std::min( (sal_Int32)40, 1000*( (sal_Int32)nBulletRelSize 
) ) ) ), FSEND );
 if( bHasFontDesc )
 mpFS-singleElementNS( XML_a, XML_buFont,
XML_typeface, 
OUStringToOString( aFontDesc.Name, RTL_TEXTENCODING_UTF8 ).getStr(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-10 Thread Björgvin Ragnarsson
 oox/source/drawingml/textcharacterproperties.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8ad2aec13205d308341da8519e15a3187b633b91
Author: Björgvin Ragnarsson nifgr...@gmail.com
Date:   Wed Dec 4 14:30:43 2013 +0100

fdo#72481 drawingml import: don't set CharEscapementHeight unconditionally

Commit 840a8573c8cebe67ddd3c9fe106c7dbd789bb334 (Fix fdo#70220
Superscript not imported from pptx., 2013-10-07) made it possible to set
CharEscapementHeight even if moBaseline is not set, but this causes
problems in the docx importer + not necessary, according to the bugdoc;
so just don't do that.

Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Commit and message cherry picked from:

commit 798a563db133ebed3876c245459d90ef54ee7c9a
Author: Miklos Vajna vmik...@collabora.co.uk

Change-Id: Ib95ac449bd8fdf6376261ddc86108f0d23f2200e
Reviewed-on: https://gerrit.libreoffice.org/8415
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index a8a8806..febb28c 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -116,7 +116,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap 
rPropMap, const XmlFil
 rPropMap[ PROP_CharStrikeout ] = GetFontStrikeout( moStrikeout.get( 
XML_noStrike ) );
 rPropMap[ PROP_CharCaseMap ] = GetCaseMap( moCaseMap.get( XML_none ) );
 
-if( !bUseOptional || moBaseline.has() ) {
+if( moBaseline.has() ) {
 rPropMap[ PROP_CharEscapement ] = sal_Int16(moBaseline.get( 0 ) / 
1000);
 rPropMap[ PROP_CharEscapementHeight ] = sal_Int8(DFLT_ESC_PROP);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-25 Thread Armin Le Grand
 oox/source/core/xmlfilterbase.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit e1187562c15594447766828ac89098fc8c964ef7
Author: Armin Le Grand a...@apache.org
Date:   Mon Feb 24 20:25:26 2014 +

Resolves: #i118640# force early destruction of last FragmentHandler...

to not let it use an already destroyed RelationsMap instance
(cherry picked from commit 190444f7fd3fa9cfcd1955b3f5dcd916184d02f4)

Conflicts:
oox/source/core/xmlfilterbase.cxx

Change-Id: Ibd09ff9fcba8f919df0704c8e3a64423518b932f
(cherry picked from commit b071ce32befcc84a57a7ecd39667cb6658c0c866)

diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 2ef319e..c0a016d 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -165,6 +165,7 @@ struct XmlFilterBaseImpl
 TextFieldStack maTextFieldStack;
 
 explicitXmlFilterBaseImpl( const Reference XComponentContext 
 rxContext ) throw( RuntimeException );
+~XmlFilterBaseImpl();
 };
 
 
@@ -177,6 +178,10 @@ XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference 
XComponentContext  rxCo
 registerNamespaces(maFastParser);
 }
 
+XmlFilterBaseImpl::~XmlFilterBaseImpl()
+{
+}
+
 XmlFilterBase::XmlFilterBase( const Reference XComponentContext  rxContext 
) throw( RuntimeException ) :
 FilterBase( rxContext ),
 mxImpl( new XmlFilterBaseImpl( rxContext ) ),
@@ -187,6 +192,14 @@ XmlFilterBase::XmlFilterBase( const Reference 
XComponentContext  rxContext )
 
 XmlFilterBase::~XmlFilterBase()
 {
+// #i118640# Reset the DocumentHandler at the FastSaxParser manually; this 
is
+// needed since the mechanism is that instances of FragmentHandler execute
+// their stuff (creating objects, setting attributes, ...) on being 
destroyed.
+// They get destroyed by setting a new DocumentHandler. This also happens 
in
+// the following implicit destruction chain of ~XmlFilterBaseImpl, but in 
that
+// case it's member RelationsMap maRelationsMap will be destroyed, but 
maybe
+// still be used by ~FragmentHandler - crash.
+mxImpl-maFastParser.setDocumentHandler( 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-2' - oox/source

2014-02-24 Thread Andras Timar
 oox/source/drawingml/chart/objectformatter.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 26bd175c7587f2d6d217885395846e8c1b5aeeda
Author: Andras Timar andras.ti...@collabora.com
Date:   Mon Feb 24 14:55:05 2014 +0100

OOXML chart import: ignore rot values outside the valid range

Change-Id: I506a78a024d761d1d263a7bb1dcbf09a4bbcf4ef

diff --git a/oox/source/drawingml/chart/objectformatter.cxx 
b/oox/source/drawingml/chart/objectformatter.cxx
index 29cc07b..2541d42 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1096,6 +1096,11 @@ void ObjectFormatter::convertTextRotation( PropertySet 
rPropSet, const ModelRef
 /*  Chart2 expects rotation angle as double value in range of [0,360).
 OOXML counts clockwise, Chart2 counts counterclockwise. */
 double fAngle = static_cast double ( bStacked ? 0 : 
rxTextProp-getTextProperties().moRotation.get( 0 ) );
+// MS Office UI allows values only in range of [-90,90].
+if ( fAngle = -540.0 || fAngle = 540.0 )
+{
+fAngle = 0.0;
+}
 fAngle = getDoubleIntervalValue double ( -fAngle / 6.0, 0.0, 
360.0 );
 rPropSet.setProperty( PROP_TextRotation, fAngle );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-24 Thread Markus Mohrhard
 oox/source/drawingml/chart/datasourceconverter.cxx |   28 +
 1 file changed, 28 insertions(+)

New commits:
commit ee09b4ed2b934eba6875688d778f4c4e9c14320b
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Sat Feb 22 05:49:39 2014 +0100

we only support simple labels in the InternalDataProvider, bnc#864396

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

diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx 
b/oox/source/drawingml/chart/datasourceconverter.cxx
index 6be4710..ea22348 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -50,6 +50,34 @@ Reference XDataSequence  
DataSequenceConverter::createDataSequence( const OUSt
 Reference XDataSequence  xDataSeq;
 if( getChartConverter() )
 {
+// the internal data table does not support complex labels
+// this is only supported in Calc!!!
+// merge the labels into a single one
+if(rRole == label)
+{
+mrModel.mnPointCount = std::minsal_Int32(mrModel.mnPointCount, 
1);
+OUStringBuffer aTitle;
+bool bFirst = true;
+for(DataSequenceModel::AnyMap::const_iterator itr = 
mrModel.maData.begin(),
+itrEnd = mrModel.maData.end(); itr != itrEnd; ++itr)
+{
+Any aAny = itr-second;
+if(aAny.hasOUString())
+{
+if(!bFirst)
+aTitle.append( );
+
+aTitle.append(aAny.getOUString());
+bFirst = false;
+}
+}
+
+if(!bFirst)
+{
+mrModel.maData.clear();
+mrModel.maData.insert(std::make_pairsal_Int32, Any(1, 
Any(aTitle.makeStringAndClear(;
+}
+}
 xDataSeq = getChartConverter()-createDataSequence( 
getChartDocument()-getDataProvider(), mrModel );
 
 // set sequen   ce role
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-18 Thread Markus Mohrhard
 oox/source/export/chartexport.cxx |   25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

New commits:
commit 2c85dc645fdecb85ca88bc4a0a34b255ff30d6b2
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Tue Feb 18 02:22:07 2014 +0100

prevent invalid OOXML files with trendlines, related #i88825#

Change-Id: I503b24233060400cf4bbb40701bec0a3e101512a
Reviewed-on: https://gerrit.libreoffice.org/8095
Reviewed-by: Kohei Yoshida libreoff...@kohei.us
Tested-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 659252b..b13867e 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2527,6 +2527,21 @@ void ChartExport::exportTrendlines( Reference 
chart2::XDataSeries  xSeries )
 
 Reference XPropertySet  xProperties( xRegCurve , uno::UNO_QUERY 
);
 
+OUString aService;
+Reference lang::XServiceName  xServiceName( xProperties, 
UNO_QUERY );
+if( !xServiceName.is() )
+continue;
+
+aService = xServiceName-getServiceName();
+
+if(aService != com.sun.star.chart2.LinearRegressionCurve 
+aService != 
com.sun.star.chart2.ExponentialRegressionCurve 
+aService != 
com.sun.star.chart2.LogarithmicRegressionCurve 
+aService != com.sun.star.chart2.PotentialRegressionCurve 

+aService != 
com.sun.star.chart2.PolynomialRegressionCurve 
+aService != 
com.sun.star.chart2.MovingAverageRegressionCurve)
+continue;
+
 pFS-startElement( FSNS( XML_c, XML_trendline ), FSEND );
 
 OUString aName;
@@ -2540,12 +2555,6 @@ void ChartExport::exportTrendlines( Reference 
chart2::XDataSeries  xSeries )
 
 exportShapeProps( xProperties );
 
-OUString aService;
-Reference lang::XServiceName  xServiceName( xProperties, 
UNO_QUERY );
-if( !xServiceName.is() )
-continue;
-aService = xServiceName-getServiceName();
-
 if( aService == com.sun.star.chart2.LinearRegressionCurve )
 {
 pFS-singleElement( FSNS( XML_c, XML_trendlineType ),
@@ -2597,7 +2606,9 @@ void ChartExport::exportTrendlines( Reference 
chart2::XDataSeries  xSeries )
 }
 else
 {
-continue;
+// should never happen
+// This would produce invalid OOXML files so we check earlier 
for the type
+assert(false);
 }
 
 double aExtrapolateForward = 0.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-2' - oox/source

2014-02-10 Thread Markus Mohrhard
 oox/source/crypto/CryptTools.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d3d5ff30d6c1de6a522d29a09d1fee37d01a3b71
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Tue Feb 11 00:08:24 2014 +0100

fix crash during file format detection, related #i101863#

Change-Id: I2aec2e95f49ab70a9e94c5d52f70855f4381a24e
Reviewed-on: https://gerrit.libreoffice.org/7986
Tested-by: Kohei Yoshida libreoff...@kohei.us
Reviewed-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx
index 6c46297..d9ba500 100644
--- a/oox/source/crypto/CryptTools.cxx
+++ b/oox/source/crypto/CryptTools.cxx
@@ -61,7 +61,10 @@ void Crypto::setupContext(vectorsal_uInt8 key, 
vectorsal_uInt8 iv, CryptoT
 
 SECItem ivItem;
 ivItem.type = siBuffer;
-ivItem.data = iv[0];
+if(iv.empty())
+ivItem.data = NULL;
+else
+ivItem.data = iv[0];
 ivItem.len = iv.size();
 
 SECItem* pIvItem = NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-06 Thread David Tardon
 oox/source/ppt/timenodelistcontext.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit dd3b06fd0f6160730aace36f8287d9bc4bd81522
Author: David Tardon dtar...@redhat.com
Date:   Thu Feb 6 13:49:05 2014 +0100

rhbz#1017379 do not remove too much from the path

Change-Id: Ibffa7f2fbe91be9b95217ce36999e286ef444a37
(cherry picked from commit 5b35f21f1c69239d0605b0751bed87a410fbffee)
Reviewed-on: https://gerrit.libreoffice.org/7896
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/oox/source/ppt/timenodelistcontext.cxx 
b/oox/source/ppt/timenodelistcontext.cxx
index ca7f1cd..cfe1f1d 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -779,7 +779,10 @@ namespace oox { namespace ppt {
 }
 
 OUString aStr = xAttribs-getOptionalValue( XML_path );
-aStr = aStr.replace( 'E', ' ' );
+// E can appear inside a number, so we only check for its 
presence at the end
+aStr = aStr.trim();
+if (aStr.endsWith(E))
+aStr = aStr.copy(0, aStr.getLength() - 1);
 aStr = aStr.trim();
 pNode-getNodeProperties()[ NP_PATH ] = makeAny(aStr);
 mnPathEditMode = xAttribs-getOptionalValueToken( 
XML_pathEditMode, 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-2' - oox/source

2014-01-24 Thread Douglas Mencken
 oox/source/crypto/AgileEngine.cxx|2 +-
 oox/source/crypto/DocumentDecryption.cxx |   17 +++--
 oox/source/crypto/Standard2007Engine.cxx |2 +-
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 6e489b4024f68fa7d07a1e41aca4ec119b43a3b7
Author: Douglas Mencken dougmenc...@gmail.com
Date:   Mon Dec 16 09:34:58 2013 -0500

Use sal_Int32 to satisfy oox/helper/helper.hxx's convertLittleEndian

Fixes build error no matching function for call to 
oox::ByteOrderConverter::convertLittleEndian(int)

workaround rather maddening endian-specific template bustage

together these two master patches hopefully fix the PPC build

(also includes: Change-Id: I69dc97c93ef5efe8d71074ac3eca06a3bbc45253)

Change-Id: I899f151ff99737247ce4090f59897eba842c40ba
Reviewed-on: https://gerrit.libreoffice.org/7099
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-on: https://gerrit.libreoffice.org/7607
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/oox/source/crypto/AgileEngine.cxx 
b/oox/source/crypto/AgileEngine.cxx
index f56e669..86d7025 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -106,7 +106,7 @@ bool AgileEngine::calculateHashFinal(const OUString 
rPassword, vectorsal_uInt8
 
 vectorsal_uInt8 data(mInfo.hashSize + 4, 0);
 
-for (int i = 0; i  mInfo.spinCount; i++)
+for (sal_Int32 i = 0; i  mInfo.spinCount; i++)
 {
 ByteOrderConverter::writeLittleEndian( data[0], i );
 std::copy(hash.begin(), hash.end(), data.begin() + 4);
diff --git a/oox/source/crypto/DocumentDecryption.cxx 
b/oox/source/crypto/DocumentDecryption.cxx
index 0d1c729..47fa006 100644
--- a/oox/source/crypto/DocumentDecryption.cxx
+++ b/oox/source/crypto/DocumentDecryption.cxx
@@ -289,9 +289,22 @@ bool 
DocumentDecryption::readStandard2007EncryptionInfo(BinaryInputStream rStre
 if( (nHeaderSize  actualHeaderSize) )
 return false;
 
-rStream  info.header;
+rStream  info.header.flags;
+rStream  info.header.sizeExtra;
+rStream  info.header.algId;
+rStream  info.header.algIdHash;
+rStream  info.header.keyBits;
+rStream  info.header.providedType;
+rStream  info.header.reserved1;
+rStream  info.header.reserved2;
+
 rStream.skip( nHeaderSize - actualHeaderSize );
-rStream  info.verifier;
+
+rStream  info.verifier.saltSize;
+rStream.readArray(info.verifier.salt, SAL_N_ELEMENTS(info.verifier.salt));
+rStream.readArray(info.verifier.encryptedVerifier, 
SAL_N_ELEMENTS(info.verifier.encryptedVerifier));
+rStream  info.verifier.encryptedVerifierHashSize;
+rStream.readArray(info.verifier.encryptedVerifierHash, 
SAL_N_ELEMENTS(info.verifier.encryptedVerifierHash));
 
 if( info.verifier.saltSize != 16 )
 return false;
diff --git a/oox/source/crypto/Standard2007Engine.cxx 
b/oox/source/crypto/Standard2007Engine.cxx
index b437846..13697d2 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -129,7 +129,7 @@ bool Standard2007Engine::calculateEncryptionKey(const 
OUString rPassword)
 // data = iterator (4bytes) + hash
 vectorsal_uInt8 data(RTL_DIGEST_LENGTH_SHA1 + 4, 0);
 
-for (int i = 0; i  5; i++)
+for (sal_Int32 i = 0; i  5; ++i)
 {
 ByteOrderConverter::writeLittleEndian( data[0], i );
 std::copy(hash.begin(), hash.end(), data.begin() + 4);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-07 Thread Muthu Subramanian
 oox/source/drawingml/customshapeproperties.cxx |6 ++
 sd/qa/unit/data/xml/n762695_0.xml  |2 +-
 sd/qa/unit/data/xml/n762695_1.xml  |4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit bec40dcd4f36bf774f6bc2d805a646ba2232175c
Author: Muthu Subramanian sumu...@collabora.com
Date:   Fri Dec 27 19:59:22 2013 +0530

fdo#72998: Custom shapes have improper size.

Change-Id: I4f8b7f80f89ad713e274acf6fc93bb415e660baf

diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index 48ace8b..247e8cf 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -213,7 +213,13 @@ void CustomShapeProperties::pushToPropSet( const 
::oox::core::FilterBase /* rFi
 aPropertyMap[ PROP_Type ] = OUString( ooxml-non-primitive );
 aPropertyMap[ PROP_MirroredX ] = Any( mbMirroredX );
 aPropertyMap[ PROP_MirroredY ] = Any( mbMirroredY );
+// Note 1: If Equations are defined - they are processed using 
internal div by 360 coordinates
+// while if they are not, standard ooxml coordinates are used.
+// This size specifically affects scaling.
+// Note 2: Width and Height are set to 0 to force scaling to 1.
 awt::Rectangle aViewBox( 0, 0, aSize.Width, aSize.Height );
+if( maGuideList.size() )
+aViewBox = awt::Rectangle( 0, 0, 0, 0 );
 aPropertyMap[ PROP_ViewBox ] = aViewBox;
 
 Sequence EnhancedCustomShapeAdjustmentValue  aAdjustmentValues( 
maAdjustmentGuideList.size() );
diff --git a/sd/qa/unit/data/xml/n762695_0.xml 
b/sd/qa/unit/data/xml/n762695_0.xml
index 5f3080f..d55c979 100644
--- a/sd/qa/unit/data/xml/n762695_0.xml
+++ b/sd/qa/unit/data/xml/n762695_0.xml
@@ -83,7 +83,7 @@
/PropertyValue
PropertyValue name=Type value=ooxml-non-primitive handle=0 
propertyState=DIRECT_VALUE/
PropertyValue name=ViewBox
-ViewBox x=0 y=0 width=4820911 height=3908235/
+ViewBox x=0 y=0 width=0 height=0/
/PropertyValue
   /CustomShapeGeometry
  /XShape
diff --git a/sd/qa/unit/data/xml/n762695_1.xml 
b/sd/qa/unit/data/xml/n762695_1.xml
index d746783..fb24ba08 100644
--- a/sd/qa/unit/data/xml/n762695_1.xml
+++ b/sd/qa/unit/data/xml/n762695_1.xml
@@ -83,7 +83,7 @@
/PropertyValue
PropertyValue name=Type value=ooxml-non-primitive handle=0 
propertyState=DIRECT_VALUE/
PropertyValue name=ViewBox
-ViewBox x=0 y=0 width=6477000 height=2743200/
+ViewBox x=0 y=0 width=0 height=0/
/PropertyValue
   /CustomShapeGeometry
  /XShape
@@ -170,7 +170,7 @@
/PropertyValue
PropertyValue name=Type value=ooxml-non-primitive handle=0 
propertyState=DIRECT_VALUE/
PropertyValue name=ViewBox
-ViewBox x=0 y=0 width=6365875 height=3430587/
+ViewBox x=0 y=0 width=0 height=0/
/PropertyValue
   /CustomShapeGeometry
  /XShape
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-03 Thread Korrawit Pruegsanusak
 oox/source/ppt/pptgraphicshapecontext.cxx |   23 ---
 1 file changed, 20 insertions(+), 3 deletions(-)

New commits:
commit a06bc4102934c47e1aebe53ea24415fafb7c506a
Author: Korrawit Pruegsanusak detective.conan.1...@gmail.com
Date:   Tue Nov 26 22:45:07 2013 +0700

fdo#71434: don't show master text if PlaceHolder types defined

I've added all of valid PlaceHolder types from
http://www.schemacentral.com/sc/ooxml/t-p_ST_PlaceholderType.html

(cherry picked from commit bb1213a740b3b3b2b1967639939dd7a72c6d4237)

Change-Id: I038fe43ff83699f92ff5eb9945bce12540058478
Reviewed-on: https://gerrit.libreoffice.org/6822
Reviewed-by: Muthu Subramanian K muthus...@gmail.com
Tested-by: Muthu Subramanian K muthus...@gmail.com
Reviewed-by: Thorsten Behrens t...@documentfoundation.org
Tested-by: Thorsten Behrens t...@documentfoundation.org

diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx 
b/oox/source/ppt/pptgraphicshapecontext.cxx
index 99c7328..730ce23 100644
--- a/oox/source/ppt/pptgraphicshapecontext.cxx
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -147,9 +147,26 @@ ContextHandlerRef PPTGraphicShapeContext::onCreateContext( 
sal_Int32 aElementTok
 if ( pPlaceholder.get() )
 {
 bool bUseText = true;
-// TODO: Check if pPlaceholder-getSubType is none (i.e. 
none explicitly specified)
-if( pPlaceholder-getSubType() == XML_obj )
-bUseText = false;
+switch( pPlaceholder-getSubType() )
+{
+case XML_title :
+case XML_body :
+case XML_ctrTitle :
+case XML_subTitle :
+case XML_dt :
+case XML_sldNum :
+case XML_ftr :
+case XML_hdr :
+case XML_obj :
+case XML_chart :
+case XML_tbl :
+case XML_clipArt :
+case XML_dgm :
+case XML_media :
+case XML_sldImg :
+case XML_pic :
+bUseText = false;
+}
 mpShapePtr-applyShapeReference( *pPlaceholder.get(), 
bUseText );
 PPTShape* pPPTShape = dynamic_cast PPTShape* ( 
pPlaceholder.get() );
 if ( pPPTShape )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-30 Thread Markus Mohrhard
 oox/source/export/chartexport.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 666ef5425e4e7e1a01c3dddbd0d847fec193176a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Dec 1 04:19:09 2013 +0100

fix validation error for OOXML chart export, related fdo#67300

Change-Id: I7d74439bba3b912fe9b81ebeca865298bc32d71e

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 36412be..756f2ed 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1278,8 +1278,11 @@ void ChartExport::exportPieChart( Reference 
chart2::XChartType  xChartType )
 sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
 exportSeries( xChartType, nAttachedAxis );
 
-// firstSliceAng
-exportFirstSliceAng( );
+if( !mbIs3DChart )
+{
+// firstSliceAng
+exportFirstSliceAng( );
+}
 
 pFS-endElement( FSNS( XML_c, nTypeId ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-30 Thread Markus Mohrhard
 oox/source/drawingml/chart/typegroupconverter.cxx |4 ++--
 sc/source/filter/excel/xichart.cxx|4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 80373a6969fd8d3c19231041e465372cf03f53f2
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Dec 1 04:45:36 2013 +0100

fix 2D vs 3D coordinatesystem regression, fdo#67300

regression from 088e86b865062dd4cc5ba0c85c6068dea62238db

diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx 
b/oox/source/drawingml/chart/typegroupconverter.cxx
index bf8e166..b87fc45 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -248,9 +248,9 @@ Reference XCoordinateSystem  
TypeGroupConverter::createCoordinateSystem()
 if( maTypeInfo.mbPolarCoordSystem )
 {
 if( mb3dChart )
-xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
-else
 xCoordSystem = 
css::chart2::PolarCoordinateSystem3d::create(xContext);
+else
+xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
 }
 else
 {
diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 51e00c1..060aa51 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2335,9 +2335,9 @@ Reference XCoordinateSystem  
XclImpChType::CreateCoordSystem( bool b3dChart )
 if( maTypeInfo.mbPolarCoordSystem )
 {
 if( b3dChart )
-xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
-else
 xCoordSystem = 
css::chart2::PolarCoordinateSystem3d::create(xContext);
+else
+xCoordSystem = 
css::chart2::PolarCoordinateSystem2d::create(xContext);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-22 Thread Michael Meeks
 oox/source/core/contexthandler2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f6e2d66c948ed8314d0c0043182a103956460ffc
Author: Michael Meeks michael.me...@collabora.com
Date:   Fri Nov 22 18:06:44 2013 +

oox: avoid per element allocation and freeing of OUStringBuffers.

Change-Id: Ie4d4d7740ae002422f73a3bfc57e1fe1ad67e50f

diff --git a/oox/source/core/contexthandler2.cxx 
b/oox/source/core/contexthandler2.cxx
index 735d339..9ac94e8 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -38,8 +38,8 @@ struct ElementInfo
 sal_Int32   mnElement;  /// The element identifier.
 boolmbTrimSpaces;   /// True = trims leading/trailing 
spaces from text data.
 
-inline explicit ElementInfo() : mnElement( XML_TOKEN_INVALID ), 
mbTrimSpaces( false ) {}
-ElementInfo( sal_Int32 nElement ) : mnElement( 
nElement ), mbTrimSpaces(false) {}
+inline explicit ElementInfo() : maChars( 0), mnElement( 
XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
+ElementInfo( sal_Int32 nElement ) : maChars( 0 ), 
mnElement( nElement ), mbTrimSpaces(false) {}
 };
 
 // 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits