[Libreoffice-commits] core.git: 3 commits - oox/source

2017-07-20 Thread Grzegorz Araminowicz
 oox/source/drawingml/diagram/diagram.cxx|6 
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx |   10 
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |  247 ++--
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx |   24 +
 oox/source/drawingml/diagram/layoutatomvisitors.cxx |  148 +++--
 oox/source/drawingml/diagram/layoutatomvisitors.hxx |   35 +-
 oox/source/drawingml/diagram/layoutnodecontext.cxx  |   32 --
 7 files changed, 286 insertions(+), 216 deletions(-)

New commits:
commit 558ded72d2a39fd0eac1f3f375b446c72b7141e5
Author: Grzegorz Araminowicz 
Date:   Wed Jul 19 22:08:38 2017 +0200

SmartArt: shape styling

Change-Id: I7e9ab4c2286fd803cd518dd01ab8ebd5ac2d8428

diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx 
b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
index a85fe611dd18..1ad24270477e 100644
--- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
+++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
@@ -122,7 +122,7 @@ 
DiagramQStylesFragmentHandler::DiagramQStylesFragmentHandler( XmlFilterBase& rFi

const AttributeList& rAttribs )
 {
 // state-table like way of navigating the color fragment. we
-// currently ignore everything except styleLbl in the colorsDef
+// currently ignore everything except styleLbl in the styleDef
 // element
 switch( getCurrentElement() )
 {
@@ -136,16 +136,16 @@ 
DiagramQStylesFragmentHandler::DiagramQStylesFragmentHandler( XmlFilterBase& rFi
 {
 switch( nElement )
 {
-case DGM_TOKEN(lnRef) : // CT_StyleMatrixReference
+case A_TOKEN(lnRef): // CT_StyleMatrixReference
 return createStyleMatrixContext(nElement,rAttribs,
 maStyleEntry.maLineStyle);
-case DGM_TOKEN(fillRef) :   // CT_StyleMatrixReference
+case A_TOKEN(fillRef):   // CT_StyleMatrixReference
 return createStyleMatrixContext(nElement,rAttribs,
 maStyleEntry.maFillStyle);
-case DGM_TOKEN(effectRef) : // CT_StyleMatrixReference
+case A_TOKEN(effectRef): // CT_StyleMatrixReference
 return createStyleMatrixContext(nElement,rAttribs,
 
maStyleEntry.maEffectStyle);
-case DGM_TOKEN(fontRef) :   // CT_FontReference
+case A_TOKEN(fontRef):   // CT_FontReference
 return createStyleMatrixContext(nElement,rAttribs,
 maStyleEntry.maTextStyle);
 }
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx 
b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 1bad1f0f4ece..fef4ad22e44a 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -320,15 +320,16 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, 
const Diagram& rDgm, sal_uI
 if( aDataNode != rDgm.getData()->getPointsPresNameMap().end() &&
 aDataNode->second.size() > nIdx )
 {
+const dgm::Point* aPresNode = aDataNode->second.at(nIdx);
 SAL_INFO(
 "oox.drawingml",
 "Filling content from " << nIdx << "th layout node named \""
 << msName << "\", modelId \""
-<< aDataNode->second.at(nIdx)->msModelId << "\"");
+<< aPresNode->msModelId << "\"");
 
 // got the presentation node - now, need the actual data node:
 const DiagramData::StringMap::const_iterator 
aNodeName=rDgm.getData()->getPresOfNameMap().find(
-aDataNode->second.at(nIdx)->msModelId);
+aPresNode->msModelId);
 if( aNodeName != rDgm.getData()->getPresOfNameMap().end() )
 {
 DiagramData::StringMap::value_type::second_type::const_iterator 
aVecIter=aNodeName->second.begin();
@@ -404,22 +405,30 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, 
const Diagram& rDgm, sal_uI
 << " for layout node named \"" << msName << "\"");
 }
 
-// TODO(Q1): apply styling & coloring - taking
-// layout node's styleLbl for both style & color
-// now, but docs are a bit unclear on this
-if( !msStyleLabel.isEmpty() )
+// TODO(Q1): apply styling & coloring - take presentation
+// point's presStyleLbl for both style & color
+// if not found use layout node's styleLbl
+// however, docs are a bit unclear on this
+OUString aStyleLabel = aPresNode->msPresentationLayoutStyleLabel;
+if (aStyleLabel.isEmpty())
+aStyleLabel = msStyleLabel;
+  

[Libreoffice-commits] core.git: 3 commits - oox/source sd/qa sd/source

2015-11-09 Thread Tomaž Vajngerl
 oox/source/ppt/slidetransition.cxx|8 
 oox/source/ppt/slidetransitioncontext.cxx |2 ++
 sd/qa/unit/data/AllTransitions.odp|binary
 sd/qa/unit/export-tests.cxx   |   12 ++--
 sd/source/filter/eppt/pptx-epptooxml.cxx  |   24 
 5 files changed, 44 insertions(+), 2 deletions(-)

New commits:
commit c24fbd8c8a4f00c4eeaa97528832afa67d4af1e7
Author: Tomaž Vajngerl 
Date:   Mon Nov 9 10:59:32 2015 +0100

pptx: import "Vortex" and "Ripple" transition + test

Change-Id: I29d71e9c07c4964275c13772cdb6042624550acb

diff --git a/oox/source/ppt/slidetransition.cxx 
b/oox/source/ppt/slidetransition.cxx
index 2c130dd..e623558 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -405,6 +405,14 @@ namespace oox { namespace ppt {
 else
 mnTransitionSubType = TransitionSubType::CORNERSOUT;
 break;
+case P14_TOKEN(vortex):
+mnTransitionType = TransitionType::MISCSHAPEWIPE;
+mnTransitionSubType = TransitionSubType::VERTICAL;
+break;
+case P14_TOKEN(ripple):
+mnTransitionType = TransitionType::MISCSHAPEWIPE;
+mnTransitionSubType = TransitionSubType::HORIZONTAL;
+break;
 default:
 mnTransitionType = 0;
 break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx 
b/oox/source/ppt/slidetransitioncontext.cxx
index 78d7825..4a9c996 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -129,6 +129,8 @@ SlideTransitionContext::~SlideTransitionContext() throw()
 case PPT_TOKEN( plus ):
 case PPT_TOKEN( random ):
 case PPT_TOKEN( wedge ):
+case P14_TOKEN( vortex ):
+case P14_TOKEN( ripple ):
 // CT_Empty
 if (!mbHasTransition)
 {
diff --git a/sd/qa/unit/data/AllTransitions.odp 
b/sd/qa/unit/data/AllTransitions.odp
index fa2eced..35b7a49 100644
Binary files a/sd/qa/unit/data/AllTransitions.odp and 
b/sd/qa/unit/data/AllTransitions.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index bba730a..f16e9e9 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -173,13 +173,15 @@ public:
 CPPUNIT_TEST(testBulletMarginAndIndentation);
 CPPUNIT_TEST(testParaMarginAndindentation);
 CPPUNIT_TEST(testTransparentBackground);
-CPPUNIT_TEST(testExportTransitionsPPTX);
 CPPUNIT_TEST(testTdf91378);
 
 #if !defined WNT
 CPPUNIT_TEST(testBnc822341);
 #endif
 CPPUNIT_TEST(testTdf80224);
+
+CPPUNIT_TEST(testExportTransitionsPPTX);
+
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1413,8 +1415,14 @@ void SdExportTest::testExportTransitionsPPTX()
 // INSIDE TURNING CUBE
 CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 60, 
TransitionType::MISCSHAPEWIPE, TransitionSubType::CORNERSIN));
 
+// VORTEX
+CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 70, 
TransitionType::MISCSHAPEWIPE, TransitionSubType::VERTICAL));
+
+// RIPPLE
+CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, 
TransitionType::MISCSHAPEWIPE, TransitionSubType::HORIZONTAL));
+
 // NEWSFLASH
-CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, TransitionType::ZOOM, 
TransitionSubType::ROTATEIN));
+CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 72, TransitionType::ZOOM, 
TransitionSubType::ROTATEIN));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
commit 733846f20c43588478d01c448f622cc9854bc59e
Author: Tomaž Vajngerl 
Date:   Mon Nov 9 10:51:06 2015 +0100

pptx: export "Ripple" and "Vortex" transition

Change-Id: I7e6683e8d4b461f193f64e2b1f077a5936008c1f

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7862bc2..9d412f7 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -560,6 +560,16 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
 pDirection14 = "r";
 bOOXmlSpecificTransition = true;
 break;
+case animations::TransitionSubType::VERTICAL: // Vortex
+nTransition = XML_fade;
+nTransition14 = XML_vortex;
+bOOXmlSpecificTransition = true;
+break;
+case animations::TransitionSubType::HORIZONTAL: // Ripple
+nTransition = XML_fade;
+nTransition14 = XML_ripple;
+bOOXmlSpecificTransition = true;
+break;
 case animations::TransitionSubType::CORNERSIN:
 pInverted = "true";
 case animations::TransitionSubType::CORNERSOUT:
commit b3120fd7c408ef0d2f35c2b0a905f5db65eaa294
Author: 

[Libreoffice-commits] core.git: 3 commits - oox/source

2015-10-09 Thread Rosemary
 oox/source/ole/vbaexport.cxx |   94 ++-
 1 file changed, 40 insertions(+), 54 deletions(-)

New commits:
commit adf8def2b09c0276f0ce836b58d7a3aa722eee15
Author: Rosemary 
Date:   Fri Oct 9 13:18:59 2015 +0200

remove redundant code

- Use the existing createHexStringFromDigit()
to export hex digits as strings

- The parameters offset and stream name
are not required

Change-Id: If9aab7816efb81655c40a11743e8951ab0b26e1d

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index fae6e80..6252165 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -72,23 +72,40 @@ void exportUTF16String(SvStream& rStrm, const OUString& 
rString)
 }
 }
 
-void exportHexString(SvStream& rStrm, const sal_uInt8 nByte)
+bool isWorkbook(css::uno::Reference xInterface)
+{
+css::uno::Reference xWorkbook(xInterface, 
css::uno::UNO_QUERY);
+return xWorkbook.is();
+}
+
+OUString createHexStringFromDigit(sal_uInt8 nDigit)
+{
+OUString aString = OUString::number( nDigit, 16 );
+if(aString.getLength() == 1)
+aString = OUString::number(0) + aString;
+return aString.toAsciiUpperCase();
+}
+
+OUString createGuidStringFromInt(sal_uInt8 nGuid[16])
 {
-sal_uInt8 nNibble = (nByte & 0xF0) >> 4;
-for(sal_uInt8 i = 0; i < 2; i++)
+OUStringBuffer aBuffer;
+aBuffer.append('{');
+for(size_t i = 0; i < 16; ++i)
 {
-if(nNibble > 9)
-rStrm.WriteUInt8(nNibble + 55);
-else
-rStrm.WriteUInt8(nNibble + 48);
-nNibble = nByte & 0xF;
+aBuffer.append(createHexStringFromDigit(nGuid[i]));
+if(i == 3|| i == 5 || i == 7 || i == 9 )
+aBuffer.append('-');
 }
+aBuffer.append('}');
+OUString aString = aBuffer.makeStringAndClear();
+return aString.toAsciiUpperCase();
 }
 
-bool isWorkbook(css::uno::Reference xInterface)
+OUString generateGUIDString()
 {
-css::uno::Reference xWorkbook(xInterface, 
css::uno::UNO_QUERY);
-return xWorkbook.is();
+sal_uInt8 nGuid[16];
+rtl_createUuid(nGuid, NULL, true);
+return createGuidStringFromInt(nGuid);
 }
 
 }
@@ -372,7 +389,6 @@ VBAEncryption::VBAEncryption(const sal_uInt8* pData, const 
sal_uInt16 length, Sv
 {
 if (!pSeed)
 {
-// mnSeed = 0xBE;
 std::random_device rd;
 std::mt19937 gen(rd());
 std::uniform_int_distribution<> dis(0, 255);
@@ -382,13 +398,13 @@ VBAEncryption::VBAEncryption(const sal_uInt8* pData, 
const sal_uInt16 length, Sv
 
 void VBAEncryption::writeSeed()
 {
-exportHexString(mrEncryptedData, mnSeed);
+exportString(mrEncryptedData, createHexStringFromDigit(mnSeed));
 }
 
 void VBAEncryption::writeVersionEnc()
 {
 mnVersionEnc = mnSeed ^ mnVersion;
-exportHexString(mrEncryptedData, mnVersionEnc);
+exportString(mrEncryptedData, createHexStringFromDigit(mnVersionEnc));
 }
 
 sal_uInt8 VBAEncryption::calculateProjKey(const OUString& rProjectKey)
@@ -408,7 +424,7 @@ sal_uInt8 VBAEncryption::calculateProjKey(const OUString& 
rProjectKey)
 void VBAEncryption::writeProjKeyEnc()
 {
 sal_uInt8 nProjKeyEnc = mnSeed ^ mnProjKey;
-exportHexString(mrEncryptedData, nProjKeyEnc);
+exportString(mrEncryptedData, createHexStringFromDigit(nProjKeyEnc));
 mnUnencryptedByte1 = mnProjKey;
 mnEncryptedByte1 = nProjKeyEnc; // ProjKeyEnc
 mnEncryptedByte2 = mnVersionEnc; // VersionEnc
@@ -421,7 +437,7 @@ void VBAEncryption::writeIgnoredEnc()
 {
 sal_uInt8 nTempValue = 0xBE; // Any value can be assigned here
 sal_uInt8 nByteEnc = nTempValue ^ (mnEncryptedByte2 + 
mnUnencryptedByte1);
-exportHexString(mrEncryptedData, nByteEnc);
+exportString(mrEncryptedData, createHexStringFromDigit(nByteEnc));
 mnEncryptedByte2 = mnEncryptedByte1;
 mnEncryptedByte1 = nByteEnc;
 mnUnencryptedByte1 = nTempValue;
@@ -435,7 +451,7 @@ void VBAEncryption::writeDataLengthEnc()
 {
 sal_uInt8 nByte = temp & 0xFF;
 sal_uInt8 nByteEnc = nByte ^ (mnEncryptedByte2 + mnUnencryptedByte1);
-exportHexString(mrEncryptedData, nByteEnc);
+exportString(mrEncryptedData, createHexStringFromDigit(nByteEnc));
 mnEncryptedByte2 = mnEncryptedByte1;
 mnEncryptedByte1 = nByteEnc;
 mnUnencryptedByte1 = nByte;
@@ -448,7 +464,7 @@ void VBAEncryption::writeDataEnc()
 for(sal_Int16 i = 0; i < mnLength; i++)
 {
 sal_uInt8 nByteEnc = mpData[i] ^ (mnEncryptedByte2 + 
mnUnencryptedByte1);
-exportHexString(mrEncryptedData, nByteEnc);
+exportString(mrEncryptedData, createHexStringFromDigit(nByteEnc));
 mnEncryptedByte2 = mnEncryptedByte1;
 mnEncryptedByte1 = nByteEnc;
 mnUnencryptedByte1 = mpData[i];
@@ -672,11 +688,11 @@ void writeMODULEDOCSTRING(SvStream& rStrm)
 }
 
 // section 2.3.4.2.3.2.5
-void 

[Libreoffice-commits] core.git: 3 commits - oox/source vcl/opengl vcl/source

2015-09-28 Thread Tomaž Vajngerl
 oox/source/crypto/Standard2007Engine.cxx |6 ++
 vcl/opengl/salbmp.cxx|   24 
 vcl/source/gdi/virdev.cxx|   10 ++
 3 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 2f9d2919e1cc73e68403b14fea1ffc92c798b23a
Author: Tomaž Vajngerl 
Date:   Mon Sep 28 16:56:31 2015 +0200

remove outputLength variable when calculating encryption verifier

Change-Id: I144957b64ba2b693db61c17e42b08014124f8c99

diff --git a/oox/source/crypto/Standard2007Engine.cxx 
b/oox/source/crypto/Standard2007Engine.cxx
index 09035d7..299d251 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -72,7 +72,6 @@ bool Standard2007Engine::generateVerifier()
 if (mKey.size() != 16)
 return false;
 
-sal_uInt32 outputLength;
 vector verifier(ENCRYPTED_VERIFIER_LENGTH);
 vector encryptedVerifier(ENCRYPTED_VERIFIER_LENGTH);
 
@@ -80,8 +79,7 @@ bool Standard2007Engine::generateVerifier()
 
 vector iv;
 Encrypt aEncryptorVerifier(mKey, iv, Crypto::AES_128_ECB);
-outputLength = aEncryptorVerifier.update(encryptedVerifier, verifier);
-if (outputLength != ENCRYPTED_VERIFIER_LENGTH)
+if (aEncryptorVerifier.update(encryptedVerifier, verifier) != 
ENCRYPTED_VERIFIER_LENGTH)
 return false;
 std::copy(encryptedVerifier.begin(), encryptedVerifier.end(), 
mInfo.verifier.encryptedVerifier);
 
@@ -93,7 +91,7 @@ bool Standard2007Engine::generateVerifier()
 vector encryptedHash(ENCRYPTED_VERIFIER_HASH_LENGTH, 0);
 
 Encrypt aEncryptorHash(mKey, iv, Crypto::AES_128_ECB);
-outputLength = aEncryptorHash.update(encryptedHash, hash, hash.size());
+aEncryptorHash.update(encryptedHash, hash, hash.size());
 std::copy(encryptedHash.begin(), encryptedHash.end(), 
mInfo.verifier.encryptedVerifierHash);
 
 return true;
commit f306af880b702d8d7e869f78240e52c8d79a138d
Author: Tomaž Vajngerl 
Date:   Mon Sep 28 12:56:20 2015 +0200

opengl: use VCL_GL_INFO in salbmp so messages appear apitrace

Change-Id: I134820fa81c206b835d68dcaa3967045038b6f33

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 6144d9a..53e4687 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -62,7 +62,7 @@ OpenGLSalBitmap::OpenGLSalBitmap()
 OpenGLSalBitmap::~OpenGLSalBitmap()
 {
 Destroy();
-SAL_INFO( "vcl.opengl", "~OpenGLSalBitmap" );
+VCL_GL_INFO( "vcl.opengl", "~OpenGLSalBitmap" );
 }
 
 bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, 
long nWidth, long nHeight )
@@ -71,7 +71,7 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long 
nX, long nY, long
 OpenGLZone aZone;
 
 Destroy();
-SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from FBO: [" << nX << ", 
" << nY << "] " << nWidth << "x" << nHeight );
+VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from FBO: [" << nX << 
", " << nY << "] " << nWidth << "x" << nHeight );
 
 mnWidth = nWidth;
 mnHeight = nHeight;
@@ -87,7 +87,7 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long 
nX, long nY, long
 else
 maTexture = OpenGLTexture( nX, nY, nWidth, nHeight );
 mbDirtyTexture = false;
-SAL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() );
+VCL_GL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() );
 
 return true;
 }
@@ -97,7 +97,7 @@ bool OpenGLSalBitmap::Create( const Size& rSize, sal_uInt16 
nBits, const BitmapP
 OpenGLZone aZone;
 
 Destroy();
-SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create with size: " << rSize );
+VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create with size: " << rSize 
);
 
 if( !isValidBitCount( nBits ) )
 return false;
@@ -127,7 +127,7 @@ bool OpenGLSalBitmap::Create( const SalBitmap& rSalBmp, 
sal_uInt16 nNewBitCount
 
 const OpenGLSalBitmap& rSourceBitmap = static_cast(rSalBmp);
 
-SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from BMP: " << 
rSourceBitmap.mnWidth << "x" << rSourceBitmap.mnHeight );
+VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from BMP: " << 
rSourceBitmap.mnWidth << "x" << rSourceBitmap.mnHeight );
 
 if( isValidBitCount( nNewBitCount ) )
 {
@@ -169,7 +169,7 @@ OpenGLTexture& OpenGLSalBitmap::GetTexture() const
 pThis->CreateTexture();
 else if( !maPendingOps.empty() )
 pThis->ExecuteOperations();
-SAL_INFO( "vcl.opengl", "Got texture " << maTexture.Id() );
+VCL_GL_INFO( "vcl.opengl", "Got texture " << maTexture.Id() );
 return pThis->maTexture;
 }
 
@@ -177,7 +177,7 @@ void OpenGLSalBitmap::Destroy()
 {
 OpenGLZone aZone;
 
-SAL_INFO( "vcl.opengl", "Destroy OpenGLSalBitmap" );
+VCL_GL_INFO( "vcl.opengl", "Destroy OpenGLSalBitmap" );
 maPendingOps.clear();
 maTexture = OpenGLTexture();
 maUserBuffer.reset();
@@ -185,7 

[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa sw/source writerfilter/source

2015-07-06 Thread Miklos Vajna
 oox/source/export/preset-definitions-to-shape-types.pl |2 -
 sw/qa/extras/rtfimport/data/tdf92481.rtf   |6 
 sw/qa/extras/rtfimport/rtfimport.cxx   |6 
 sw/source/filter/ww8/docxsdrexport.cxx |   24 
 writerfilter/source/dmapper/SettingsTable.cxx  |   25 +++--
 writerfilter/source/ooxml/model.xml|4 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 ++
 7 files changed, 55 insertions(+), 15 deletions(-)

New commits:
commit 0afd9dbc08ee2e55e0845dd33ece10ff9375bfa7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jul 6 09:15:22 2015 +0200

sw: fix newly introduced style inconsistencies in docxsdrexport

Change-Id: I9b9f198aa6da2f6734194207b4c4bdec3ee1d4c0

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index b59de52..8244171 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1473,14 +1473,14 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId, bo
 
 //first, loop through ALL of the chained textboxes to identify a unique ID 
for each chain, and sequence number for each textbox in that chain.
 std::mapOUString, MSWordExportBase::LinkedTextboxInfo::iterator 
linkedTextboxesIter;
-if( !m_pImpl-m_rExport.m_bLinkedTextboxesHelperInitialized )
+if (!m_pImpl-m_rExport.m_bLinkedTextboxesHelperInitialized)
 {
 sal_Int32 nSeq=0;
 linkedTextboxesIter = 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.begin();
-while ( linkedTextboxesIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end() )
+while (linkedTextboxesIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end())
 {
 //find the start of a textbox chain: has no PREVIOUS link, but 
does have NEXT link
-if ( linkedTextboxesIter-second.sPrevChain.isEmpty()  
!linkedTextboxesIter-second.sNextChain.isEmpty() )
+if (linkedTextboxesIter-second.sPrevChain.isEmpty()  
!linkedTextboxesIter-second.sNextChain.isEmpty())
 {
 //assign this chain a unique ID and start a new sequence
 nSeq = 0;
@@ -1492,18 +1492,18 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId, bo
 //follow the chain and assign the same id, and incremental 
sequence numbers.
 std::mapOUString, 
MSWordExportBase::LinkedTextboxInfo::iterator  followChainIter;
 followChainIter = 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.find(linkedTextboxesIter-second.sNextChain);
-while ( followChainIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end() )
+while (followChainIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end())
 {
 //verify that the NEXT textbox also points to me as the 
PREVIOUS.
 // A broken link indicates a leftover remnant that can be 
ignored.
-if( followChainIter-second.sPrevChain != 
sCheckForBrokenChains )
+if (followChainIter-second.sPrevChain != 
sCheckForBrokenChains)
 break;
 
 followChainIter-second.nId = 
m_pImpl-m_rExport.m_nLinkedTextboxesChainId;
 followChainIter-second.nSeq = ++nSeq;
 
 //empty next chain indicates the end of the linked chain.
-if ( followChainIter-second.sNextChain.isEmpty() )
+if (followChainIter-second.sNextChain.isEmpty())
 break;
 
 sCheckForBrokenChains = followChainIter-first;
@@ -1520,19 +1520,19 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* 
pParentFrame, int nAnchorId, bo
 bool isTxbxLinked = false ;
 
 OUString sLinkChainName;
-if ( xPropSetInfo.is() )
+if (xPropSetInfo.is())
 {
-if ( xPropSetInfo-hasPropertyByName(LinkDisplayName) )
+if (xPropSetInfo-hasPropertyByName(LinkDisplayName))
 xPropertySet-getPropertyValue(LinkDisplayName) = 
sLinkChainName;
-else if ( xPropSetInfo-hasPropertyByName(ChainName) )
+else if (xPropSetInfo-hasPropertyByName(ChainName))
 xPropertySet-getPropertyValue(ChainName) = sLinkChainName;
 }
 
 // second, check if THIS textbox is linked and then decide whether to 
write the tag txbx or linkedTxbx
 linkedTextboxesIter = 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.find(sLinkChainName);
-if ( linkedTextboxesIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end() )
+if (linkedTextboxesIter != 
m_pImpl-m_rExport.m_aLinkedTextboxesHelper.end())
 {
-if( (linkedTextboxesIter-second.nId !=0)  
(linkedTextboxesIter-second.nSeq != 0) )
+if ((linkedTextboxesIter-second.nId !=0)  
(linkedTextboxesIter-second.nSeq != 0))
 {
  

[Libreoffice-commits] core.git: 3 commits - oox/source sc/inc sc/source

2015-05-14 Thread Markus Mohrhard
 oox/source/core/xmlfilterbase.cxx  |2 
 oox/source/token/namespaces-strict.txt |4 
 oox/source/token/namespaces.hxx.tail   |2 
 oox/source/token/namespaces.txt|4 
 oox/source/token/tokens.txt|1 
 sc/inc/colorscale.hxx  |4 
 sc/source/core/data/colorscale.cxx |   21 +++
 sc/source/filter/inc/condformatbuffer.hxx  |9 +
 sc/source/filter/inc/condformatcontext.hxx |   10 +
 sc/source/filter/inc/extlstcontext.hxx |   21 +++
 sc/source/filter/oox/condformatbuffer.cxx  |   63 --
 sc/source/filter/oox/condformatcontext.cxx |   46 ++-
 sc/source/filter/oox/extlstcontext.cxx |  182 -
 13 files changed, 309 insertions(+), 60 deletions(-)

New commits:
commit 0abbb1172248574ae87bc91aa77eb2420be55152
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri May 15 05:08:21 2015 +0200

import cusotm icon set collections from OOXML

Change-Id: I92c8a55d313cb1b066bd3ec8822b8a8edeb6b749

diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 3e6f05a..5b41742 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -131,6 +131,7 @@ public:
 void importCfvo( const AttributeList rAttribs );
 void importAttribs( const AttributeList rAttribs );
 void importFormula(const OUString rFormula);
+void importIcon(const AttributeList rAttribs);
 
 void SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScAddress 
rAddr );
 
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 7483a06..2917e08 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -367,26 +367,49 @@ void IconSetRule::importFormula(const OUString rFormula)
 rEntry.maFormula = rFormula;
 }
 
+namespace {
 
-void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const 
ScAddress rPos )
+ScIconSetType getType(const OUString rName)
 {
-for(size_t i = 0; i  maEntries.size(); ++i)
-{
-ScColorScaleEntry* pModelEntry = ConvertToModel( maEntries[i], pDoc, 
rPos );
-mxFormatData-maEntries.push_back(pModelEntry);
-}
-
 ScIconSetType eIconSetType = IconSet_3TrafficLights1;
 ScIconSetMap* pIconSetMap = ScIconSetFormat::getIconSetMap();
 for(size_t i = 0; pIconSetMap[i].pName; ++i)
 {
-if(OUString::createFromAscii(pIconSetMap[i].pName) == maIconSetType)
+if(OUString::createFromAscii(pIconSetMap[i].pName) == rName)
 {
 eIconSetType = pIconSetMap[i].eType;
 break;
 }
 }
-mxFormatData-eIconSetType = eIconSetType;
+
+return eIconSetType;
+}
+
+}
+
+void IconSetRule::importIcon(const AttributeList rAttribs)
+{
+OUString aIconSet = rAttribs.getString(XML_iconSet, OUString());
+sal_Int32 nIndex = rAttribs.getInteger(XML_iconId, -1);
+if (aIconSet == NoIcons)
+{
+nIndex = -1;
+}
+
+ScIconSetType eIconSetType = getType(aIconSet);
+mxFormatData-maCustomVector.push_back(std::pairScIconSetType, 
sal_Int32(eIconSetType, nIndex));
+}
+
+void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const 
ScAddress rPos )
+{
+for(size_t i = 0; i  maEntries.size(); ++i)
+{
+ScColorScaleEntry* pModelEntry = ConvertToModel( maEntries[i], pDoc, 
rPos );
+mxFormatData-maEntries.push_back(pModelEntry);
+}
+
+mxFormatData-eIconSetType = getType(maIconSetType);
+mxFormatData-mbCustom = mbCustom;
 pFormat-SetIconSetData(mxFormatData.release());
 }
 
diff --git a/sc/source/filter/oox/condformatcontext.cxx 
b/sc/source/filter/oox/condformatcontext.cxx
index 08ce68b..5ba13c8 100644
--- a/sc/source/filter/oox/condformatcontext.cxx
+++ b/sc/source/filter/oox/condformatcontext.cxx
@@ -143,6 +143,7 @@ void IconSetContext::onStartElement( const AttributeList 
rAttribs )
 mpIconSet-importCfvo( rAttribs );
 break;
 case XLS14_TOKEN(cfIcon):
+mpIconSet-importIcon(rAttribs);
 break;
 }
 }
commit c6c1a4a7a38eb13c45b6c865f310d797fc3f1152
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri May 15 05:07:52 2015 +0200

support custom iconSet collections

Change-Id: If54afe3535dd20f77cab9d15ba2d575ddeb89986

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 593a662..dd28d47 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -338,6 +338,10 @@ struct ScIconSetFormatData
  */
 bool mbReverse;
 boost::ptr_vectorScColorScaleEntry maEntries;
+bool mbCustom;
+// the std::pair points to exactly one image
+// std..pair::second == -1 means no image
+std::vectorstd::pairScIconSetType, sal_Int32  maCustomVector;
 
 ScIconSetFormatData():
 eIconSetType(IconSet_3Arrows),
diff --git 

[Libreoffice-commits] core.git: 3 commits - oox/source

2015-04-21 Thread Markus Mohrhard
 oox/source/export/chartexport.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit d8dcf2d4861b830ce9dfdf04bee4d365b4724d1e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 21 19:17:00 2015 +0200

fix marker export if none is selected

Change-Id: I7e09a355d515c4782605602b2e5edc93e70921fd

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index cd1d814..3c609be 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3093,7 +3093,7 @@ void ChartExport::exportMarker(Reference 
chart2::XDataSeries  xSeries)
 if( GetProperty( xPropSet, Symbol ) )
 mAny = aSymbol;
 
-if(aSymbol.Style != chart2::SymbolStyle_STANDARD  aSymbol.Style != 
chart2::SymbolStyle_AUTO)
+if(aSymbol.Style != chart2::SymbolStyle_STANDARD  aSymbol.Style != 
chart2::SymbolStyle_AUTO  aSymbol.Style != chart2::SymbolStyle_NONE)
 return;
 
 FSHelperPtr pFS = GetFS();
commit a4f16736496fda7b29561de14fe8990028e88799
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 21 19:16:38 2015 +0200

first step for better scatterStyle export

Change-Id: I33f7a0e629564834730a13a8501100a62f16017e

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index f8a33a8..cd1d814 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1558,7 +1558,18 @@ void ChartExport::exportScatterChart( Reference 
chart2::XChartType  xChartType
 pFS-startElement( FSNS( XML_c, XML_scatterChart ),
 FSEND );
 // TODO:scatterStyle
+
+sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
+Reference XPropertySet  xPropSet( mxDiagram , uno::UNO_QUERY);
+if( GetProperty( xPropSet, SymbolType ) )
+mAny = nSymbolType;
+
 const char* scatterStyle = lineMarker;
+if (nSymbolType == css::chart::ChartSymbolType::NONE)
+{
+scatterStyle = line;
+}
+
 pFS-singleElement( FSNS( XML_c, XML_scatterStyle ),
 XML_val, scatterStyle,
 FSEND );
commit c8961a43bd6605f4a06165f31f7a7fbb8ffdb8d0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 21 13:36:09 2015 +0200

export data labels for all chart types, tdf#90729

Change-Id: I55b9b87a8de2ecee4f1ae3159938bfd2fb3acbaa

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 445c341..f8a33a8 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1820,10 +1820,7 @@ void ChartExport::exportSeries( Reference 
chart2::XChartType  xChartType, sal_
 exportDataPoints( uno::Reference beans::XPropertySet ( 
aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
 
 // export data labels
-// Excel does not like our current data label export
-// for scatter charts
-if( eChartType != chart::TYPEID_SCATTER )
-exportDataLabels(aSeriesSeq[nSeriesIdx], 
nSeriesLength, eChartType);
+exportDataLabels(aSeriesSeq[nSeriesIdx], nSeriesLength, 
eChartType);
 
 exportTrendlines( aSeriesSeq[nSeriesIdx] );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - oox/source sd/qa

2014-07-15 Thread Matúš Kukan
 oox/source/drawingml/table/tablecell.cxx   |8 ++-
 oox/source/drawingml/table/tableproperties.cxx |2 
 sd/qa/unit/data/pptx/bnc887225.pptx|binary
 sd/qa/unit/import-tests.cxx|   51 +
 4 files changed, 58 insertions(+), 3 deletions(-)

New commits:
commit 3d76a540f64f1f55f35863f18eed4b315e0d1e64
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jul 15 14:01:01 2014 +0200

Unit test for cell properties, where lastRow is used in table (bnc#887225)

Change-Id: Ia11dadcbedf6acc035b2d86da39a115bdb298591

diff --git a/sd/qa/unit/data/pptx/bnc887225.pptx 
b/sd/qa/unit/data/pptx/bnc887225.pptx
new file mode 100755
index 000..e5c528f
Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc887225.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 01aade4..e8e148f 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -29,6 +29,7 @@
 #include svx/svdogrp.hxx
 #include svx/svdomedia.hxx
 #include svx/svdoole2.hxx
+#include svx/svdotable.hxx
 #include svx/xflclit.hxx
 #include animations/animationnodehelper.hxx
 
@@ -69,6 +70,7 @@ public:
 void testN862510_2();
 void testN862510_4();
 void testBnc870237();
+void testBnc887225();
 
 CPPUNIT_TEST_SUITE(SdFiltersTest);
 CPPUNIT_TEST(testDocumentLayout);
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testN862510_2);
 CPPUNIT_TEST(testN862510_4);
 CPPUNIT_TEST(testBnc870237);
+CPPUNIT_TEST(testBnc887225);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -550,6 +553,54 @@ void SdFiltersTest::testBnc870237()
 xDocShRef-DoClose();
 }
 
+void SdFiltersTest::testBnc887225()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL( 
getURLFromSrc(/sd/qa/unit/data/pptx/bnc887225.pptx) );
+// In the document, lastRow and lastCol table properties are used.
+// Make sure styles are set properly for individual cells.
+
+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(2));
+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(6003669), nColor);
+
+xCell.set(xTable-getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
+
+xCell.set(xTable-getCellByPosition(1, 1), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(13754095), nColor);
+
+xCell.set(xTable-getCellByPosition(1, 2), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(15331319), nColor);
+
+xCell.set(xTable-getCellByPosition(1, 4), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
+
+xCell.set(xTable-getCellByPosition(3, 2), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
+
+xCell.set(xTable-getCellByPosition(3, 4), uno::UNO_QUERY_THROW);
+xCell-getPropertyValue(FillColor) = nColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor);
+
+xDocShRef-DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 5d2f12a44d2af3e42e0c3a17ff556f5ada27b1b8
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

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 6862594..e91f5b8 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 ( 

[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa sw/source

2014-06-17 Thread Miklos Vajna
 oox/source/export/vmlexport.cxx |   14 +++-
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |   42 ++---
 sw/source/filter/ww8/docxsdrexport.cxx  |   47 +---
 3 files changed, 80 insertions(+), 23 deletions(-)

New commits:
commit e1386e32a85eb5c6b4294a8ca3e4461b92707fc3
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 18 01:20:41 2014 +0200

DocxSdrExport::writeDMLAndVMLDrawing: fix handling of inline VML shapes

In general Writer supports having objects inside a TextFrame, Word does
not. It turns out that Word allows having certain shapes inside other
shapes, as long as they are VML-only. So do that for now: if we receive
a shape when we're already inside a shape, then just export it as VML,
not the usual drawingml+VML pair.

Also, blacklist one more VML shape type, where the shape text is already
exported inside v:textpath, so no dedicated v:textbox is needed.

Change-Id: I5786bd6827eae9756e7c179bb2ef5a5741a91878

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index ad24db2..490bc7b 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -971,6 +971,18 @@ bool lcl_isTextBox(const SdrObject* pSdrObject)
 return false;
 }
 
+bool lcl_hasTextBoxContent(sal_uInt32 nShapeType)
+{
+switch (nShapeType)
+{
+case ESCHER_ShpInst_TextPlainText:
+case ESCHER_ShpInst_TextSlantUp:
+return false;
+default:
+return true;
+}
+}
+
 OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject)
 {
 OUString aResult;
@@ -1126,7 +1138,7 @@ sal_Int32 VMLExport::StartShape()
 
 // now check if we have some editeng text (not associated textbox) and we 
have a text exporter registered
 const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);
-if (pTxtObj  m_pTextExport  m_nShapeType != 
ESCHER_ShpInst_TextPlainText  !IsWaterMarkShape(m_pSdrObject-GetName())  
!lcl_isTextBox(m_pSdrObject))
+if (pTxtObj  m_pTextExport  lcl_hasTextBoxContent(m_nShapeType)  
!IsWaterMarkShape(m_pSdrObject-GetName())  !lcl_isTextBox(m_pSdrObject))
 {
 const OutlinerParaObject* pParaObj = 0;
 bool bOwnParaObj = false;
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 2fbf4a9..0d9e0ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1685,9 +1685,23 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, 
testWordArtWithinDraingto
 xmlDocPtr pXmlDoc = parseExport(word/document.xml);
 if (!pXmlDoc)
return;
-
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
-
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
-
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+if (xIndexAccess-getCount())
+{
+// TODO TextBox: remove this when TextBox is enabled by default
+// This second run is a bug, should be the first ideally
+
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+}
+else
+{
+
assertXPath(pXmlDoc,/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1],1);
+

[Libreoffice-commits] core.git: 3 commits - oox/source rsc/source sd/source svgio/source writerfilter/source

2014-05-29 Thread Julien Nabet
 oox/source/drawingml/shapecontext.cxx  |1 -
 rsc/source/rscpp/cpp2.c|1 -
 sd/source/ui/dlg/docprev.cxx   |2 +-
 svgio/source/svgreader/svgtools.cxx|1 -
 writerfilter/source/dmapper/ThemeTable.cxx |1 -
 5 files changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 839dde414f88c095237a956d2d9b97afc0d05a0d
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu May 29 20:45:46 2014 +0200

cppcheck: consecutive return/break/...

Change-Id: I171df68539fc41046b706157c04ab1e8cc1e60ca

diff --git a/oox/source/drawingml/shapecontext.cxx 
b/oox/source/drawingml/shapecontext.cxx
index bc246d2..74cc2d9 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -104,7 +104,6 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 
aElementToken, const
 {
 mpShapePtr-getTextBody()-getTextProperties().moRotation = 
rAttribs.getInteger( XML_rot );
 return 0;
-break;
 }
 case XML_cNvSpPr:
 break;
diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c
index 1431e15..578052c 100644
--- a/rsc/source/rscpp/cpp2.c
+++ b/rsc/source/rscpp/cpp2.c
@@ -278,7 +278,6 @@ nest_err:   cerror(#%s must be in an #if, token);
 cput(c);
 fprintf( pCppOut, \n );
 exit( 1 );
-break;
 }
 default:
 /*
diff --git a/svgio/source/svgreader/svgtools.cxx 
b/svgio/source/svgreader/svgtools.cxx
index afc6fec..8c7ba0f 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -186,7 +186,6 @@ namespace svgio
 }
 
 return fRetval;
-break;
 }
 default:
 {
commit c46cc5751b5af4ce180fca63f998fe7eb405f93c
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu May 29 20:45:00 2014 +0200

cppcheck: zerodiv

Change-Id: I09e1c86bdda301c11700ffe05d4a3d83b7a1104d

diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index cd015cd..4c4293c 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -87,7 +87,7 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, 
Size rSize, Point rP
 long nWidth = rSize.Width() - 2*FRAME;
 long nHeight = rSize.Height() - 2*FRAME;
 if( nWidth  0 ) nWidth = 0;
-if( nHeight  0 ) nHeight = 0;
+if( nHeight  0 ) nHeight = 1;
 
 double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
 double dRatioPreV=((double) nWidth ) / nHeight;
commit 1af3579ecbe3747bcb9535d026d2a34792cd9106
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu May 29 20:44:49 2014 +0200

cppcheck: unused variable

Change-Id: If497a2bbcc13702a960f510b3daf3bf7dc12d4c7

diff --git a/writerfilter/source/dmapper/ThemeTable.cxx 
b/writerfilter/source/dmapper/ThemeTable.cxx
index 2cc3566..7817175 100644
--- a/writerfilter/source/dmapper/ThemeTable.cxx
+++ b/writerfilter/source/dmapper/ThemeTable.cxx
@@ -177,7 +177,6 @@ void ThemeTable::lcl_entry(int /*pos*/, 
writerfilter::ReferenceProperties::Poi
 
 OUString ThemeTable::getStringForTheme(const Id id)
 {
-std::mapsal_uInt32, OUString tmpThemeFontMap;
 switch (id)
 {
 case NS_ooxml::LN_Value_ST_Theme_majorEastAsia:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - oox/source

2014-05-23 Thread Miklos Vajna
 oox/source/drawingml/textbodycontext.cxx |   11 +++
 1 file changed, 11 insertions(+)

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

diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index 28b56e4..69b2396 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;
commit fa017a3e503cc654b8756e1056feb1ee98225310
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri May 23 09:17:01 2014 +0200

DOCX import: detect inline shape inside shape text

Change-Id: Ia1614759558e73686fce137eb52fb623eae4a4e5

diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index 1dd5a6c..28b56e4 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -146,6 +146,8 @@ ContextHandlerRef RegularTextRunContext::onCreateContext( 
sal_Int32 aElementToke
 case OOX_TOKEN( doc, t ):
 mbIsInText = true;
 break;
+case OOX_TOKEN( doc, drawing ):
+break;
 default:
 SAL_WARN(oox, RegularTextRunContext::onCreateContext: unhandled 
element:   getBaseToken(aElementToken));
 break;
commit 86283cd75e798ce7fd5ca0e91ac3ea0733d31404
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri May 23 08:50:50 2014 +0200

DOCX import: detect table in groupshape

Change-Id: Iba7bb88139a97e919739363cd85f3e822062b694

diff --git a/oox/source/drawingml/textbodycontext.cxx 
b/oox/source/drawingml/textbodycontext.cxx
index 9821149..1dd5a6c 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -181,6 +181,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( 
sal_Int32 aElementToken, con
 case OOX_TOKEN( doc, sdtPr ):
 case OOX_TOKEN( doc, sdtEndPr ):
 break;
+case OOX_TOKEN( doc, tbl ):
+break;
 default:
 SAL_WARN(oox, TextBodyContext::onCreateContext: unhandled element: 
  getBaseToken(aElementToken));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa

2014-04-23 Thread Stephan Bergmann
 oox/source/drawingml/effectpropertiescontext.cxx |4 
 sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx  |5 ++---
 3 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 513a21aa6cf350c094289a7976de9e0cc0e7b4d4
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 23 22:52:06 2014 +0200

Revert sw: disable failing checks

This reverts commit e7646e7e389a6a8c6481bd75127207b5090b126d.

diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 4995a9d..cc04809 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1097,13 +1097,12 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, 
shape-effect-preservation
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
 
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw,
 dist, 50800);
-/* FIXME why does this fail?
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
 
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr,
 val, 00);
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
 
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha,
-val, 5); */
+val, 5);
 }
 
 #endif
commit 861db4c1656956c82bf21489c0068b996bb66cac
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 23 22:51:14 2014 +0200

Monkey see, monkey do?

At least, it makes CppunitTest_sw_ooxmlsdrexport succeed again.

Change-Id: I05b9de5366b0e3d2007311d00991758b6d6f8dba

diff --git a/oox/source/drawingml/effectpropertiescontext.cxx 
b/oox/source/drawingml/effectpropertiescontext.cxx
index 458ee59..40f7318 100644
--- a/oox/source/drawingml/effectpropertiescontext.cxx
+++ b/oox/source/drawingml/effectpropertiescontext.cxx
@@ -82,6 +82,10 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( 
sal_Int32 nElement,
 {
 mrEffectProperties.msUnsupportedEffectName = innerShdw;
 saveUnsupportedAttribs( rAttribs );
+
+mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( 
XML_dist, 0 );
+mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( 
XML_dir, 0 );
+return new ColorContext( *this, 
mrEffectProperties.maShadow.moShadowColor );
 }
 break;
 }
commit 8485a276022e05bd34afb2321e72ecfad4589f7e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 23 22:50:09 2014 +0200

Change RGB 00 - 00 to keep roundtrip test happy

Change-Id: I14e48d56b6f34be31a1580d448352b925f9aadde

diff --git a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx 
b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx
index 97787eb..35c7aba 100644
Binary files a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx and 
b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 8a73e85..4995a9d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -1100,7 +1100,7 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, 
shape-effect-preservation
 /* FIXME why does this fail?
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
 
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr,
-val, 00);
+val, 00);
 assertXPath(pXmlDoc, 
/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/
 
wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha,
 val, 5); */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa sw/source

2014-04-15 Thread Jacobo Aragunde Pérez
 oox/source/drawingml/customshapeproperties.cxx |6 ++--
 oox/source/drawingml/shape.cxx |   19 +++--
 sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx|   35 +++--
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   29 
 sw/source/filter/ww8/docxsdrexport.cxx |8 ++---
 5 files changed, 79 insertions(+), 18 deletions(-)

New commits:
commit 1393ba60b1eb43b55820f74c393da04308221d97
Author: Jacobo Aragunde Pérez jaragu...@igalia.com
Date:   Mon Apr 14 18:53:34 2014 +0200

fdo#70838: fix rotation transformation in DML exporter

This patch fixes an error in commit
c6ff03f37a6898f50a5ca07152168fb4fe911e05.

And now that fdo#75722 is fixed, I completed the existing unit test
for this bug with absolute position checks.

Change-Id: I76b4fa046db9b946fd23194e91686ffa4fcb5362

diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 5f5ecf9..674b496 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
@@ -503,16 +503,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, fdo70838.docx)
 aYPos[2] = getXPathContent(pXmlDocument, 
/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset).toInt32();
 aYPos[3] = getXPathContent(pXmlDocument, 
/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset).toInt32();
 
-// TODO: compare values with a reference value extracted from the original 
document
-//   depends on fdo#75722
 // certain degree of error is tolerated due to rounding in unit conversions
-CPPUNIT_ASSERT(abs(aXPos[0] - aXPos[1])  1000);
-CPPUNIT_ASSERT(abs(aXPos[1] - aXPos[2])  1000);
-CPPUNIT_ASSERT(abs(aXPos[2] - aXPos[3])  1000);
+CPPUNIT_ASSERT(abs(1239520 - aXPos[0])  1000);
+CPPUNIT_ASSERT(abs(1239520 - aXPos[1])  1000);
+CPPUNIT_ASSERT(abs(1238250 - aXPos[2])  1000);
+CPPUNIT_ASSERT(abs(1238885 - aXPos[3])  1000);
 
-CPPUNIT_ASSERT(abs(aYPos[0] - aYPos[1])  1000);
-CPPUNIT_ASSERT(abs(aYPos[1] - aYPos[2])  1000);
-CPPUNIT_ASSERT(abs(aYPos[2] - aYPos[3])  1000);
+CPPUNIT_ASSERT(abs(2095500 - aYPos[0])  1000);
+CPPUNIT_ASSERT(abs(2094865 - aYPos[1])  1000);
+CPPUNIT_ASSERT(abs(2094230 - aYPos[2])  1000);
+CPPUNIT_ASSERT(abs(2094865 - aYPos[3])  1000);
 
 sal_Int32 aHSize[4], aVSize[4];
 aHSize[0] = getXPath(pXmlDocument, 
/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent,
 cx).toInt32();
@@ -586,6 +586,25 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, fdo70838.docx)
 
 } while( nextTokenPos != -1 );
 }
+
+// Check shape objects
+
+awt::Point aPos[4];
+aPos[0] = getShape(1)-getPosition();
+aPos[1] = getShape(2)-getPosition();
+aPos[2] = getShape(3)-getPosition();
+aPos[3] = getShape(4)-getPosition();
+
+// certain degree of error is tolerated due to rounding in unit conversions
+CPPUNIT_ASSERT(abs(4734 - aPos[0].X)  10);
+CPPUNIT_ASSERT(abs(4734 - aPos[1].X)  10);
+CPPUNIT_ASSERT(abs(4731 - aPos[2].X)  10);
+CPPUNIT_ASSERT(abs(4733 - aPos[3].X)  10);
+
+CPPUNIT_ASSERT(abs(2845 - aPos[0].Y)  10);
+CPPUNIT_ASSERT(abs(2843 - aPos[1].Y)  10);
+CPPUNIT_ASSERT(abs(2842 - aPos[2].Y)  10);
+CPPUNIT_ASSERT(abs(2843 - aPos[3].Y)  10);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testFdo73215, fdo73215.docx)
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index c80cce0..a2cb109 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -85,7 +85,7 @@ OUString lclGetAnchorIdFromGrabBag(const SdrObject* pObj)
 return aResult;
 }
 
-void lclMovePositionWithRotation(awt::Point aPos, sal_Int64 nRotation)
+void lclMovePositionWithRotation(awt::Point aPos, const Size rSize, 
sal_Int64 nRotation)
 {
 // code from ImplEESdrWriter::ImplFlipBoundingBox 
(filter/source/msfilter/eschesdo.cxx)
 // TODO: refactor
@@ -104,8 +104,8 @@ void lclMovePositionWithRotation(awt::Point aPos, 
sal_Int64 nRotation)
 double  fCos = cos(fVal);
 double  fSin = sin(fVal);
 
-double  nWidthHalf = (double) aPos.X / 2;
-double  nHeightHalf = (double) aPos.Y / 2;
+double  nWidthHalf = (double) rSize.Width() / 2;
+double  nHeightHalf = (double) rSize.Height() / 2;
 
 double nXDiff = fSin * nHeightHalf + fCos * nWidthHalf  - nWidthHalf;
 double nYDiff = fSin * nWidthHalf  + fCos * nHeightHalf - nHeightHalf;
@@ -303,7 +303,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* 
pFrmFmt, const Size rS
 // SdrObjects know their layer, consider that instead of the frame 
format.
 bOpaque = pObj-GetLayer() != pFrmFmt-GetDoc()-GetHellId()  
pObj-GetLayer() != pFrmFmt-GetDoc()-GetInvisibleHellId();
 
-

[Libreoffice-commits] core.git: 3 commits - oox/source

2014-03-07 Thread Markus Mohrhard
 oox/source/export/vmlexport.cxx   |4 ++--
 oox/source/helper/propertymap.cxx |1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 78e2431d3e1aafe672a40d2ce79fbb1c48244fff
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Fri Mar 7 22:54:50 2014 +0100

fix OOXML validation error

Change-Id: I02082c04832959ae520b964ab3fd5e0b0fc34173

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a1e1dea..35eeae7 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -366,7 +366,7 @@ void VMLExport::Commit( EscherPropertyContainer rProps, 
const Rectangle rRect
 }
 if ( pWrapType )
 m_pSerializer-singleElementNS( XML_w10, XML_wrap,
-FSNS( XML_v, XML_type ), pWrapType,
+XML_type, pWrapType,
 FSEND );
 }
 bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
commit 60b36a7968782f44fa9351649f8cdd28ad85f40d
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Fri Mar 7 22:15:13 2014 +0100

fix OOXML validation error, related fdo#42584

Use correct namespace for detectmouseclick

Change-Id: I2830ef089ade94e69a49cb8ceba7fe91fa86817f

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index de62d73..a1e1dea 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -578,7 +578,7 @@ void VMLExport::Commit( EscherPropertyContainer rProps, 
const Rectangle rRect
 }
 
 if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) )
-impl_AddBool( pAttrList, XML_detectmouseclick, nValue 
!= 0 );
+impl_AddBool( pAttrList, FSNS(XML_o, 
XML_detectmouseclick), nValue != 0 );
 
 if (rProps.GetOpt(ESCHER_Prop_fillOpacity, nValue))
 // Partly undo the transformation at the end of 
EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1.
commit 2e2c4aa158bd8da84ea6d6f23bcef58e939e08de
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Fri Mar 7 21:54:09 2014 +0100

remove remaining debug logging

Change-Id: I81eb911ae6117fb557d6d5730a4d381d6fd75f4b

diff --git a/oox/source/helper/propertymap.cxx 
b/oox/source/helper/propertymap.cxx
index 5e27b44..a06afd9 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -201,7 +201,6 @@ bool PropertyMap::setAnyProperty( sal_Int32 nPropId, const 
Any rValue )
 if( nPropId  0 )
 return false;
 
-SAL_WARN_IF(sal_Int32(mpPropNames-size()) = nPropId, oox, invalid 
PropId);
 maProperties[ nPropId ] = rValue;
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-17 Thread Markus Mohrhard
 oox/source/export/vmlexport.cxx |5 +
 sc/source/filter/excel/xeescher.cxx |5 -
 sc/source/filter/excel/xepivot.cxx  |   11 ++-
 sc/source/filter/inc/xepivot.hxx|3 ++-
 4 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit cd03b4ac54076b5471bf8b3154ecb6b4e7cc
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Mon Feb 17 05:39:07 2014 +0100

fix invalid string access, related #i83611#

Change-Id: I5954f78e10d99a064f83e96282c28c086c7f07f1

diff --git a/sc/source/filter/excel/xeescher.cxx 
b/sc/source/filter/excel/xeescher.cxx
index 4a9fb82..67ac325 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -691,7 +691,10 @@ XclExpTbxControlObj::XclExpTbxControlObj( 
XclExpObjectManager rRoot, Reference
 //Export description as alt text
 if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
 {
-OUString  aAltTxt = pSdrObj-GetDescription().copy( 0, 
MSPROP_DESCRIPTION_MAX_LEN );
+OUString aAltTxt;
+OUString aDescrText = pSdrObj-GetDescription();
+if(!aDescrText.isEmpty())
+aAltTxt = aDescrText.copy( 0, 
std::minsal_Int32(MSPROP_DESCRIPTION_MAX_LEN, aDescrText.getLength()) );
 aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt );
 }
 
commit 8a5c8c251fe42f639b029f72244326cdc1b3bb7b
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Sun Feb 16 22:07:20 2014 +0100

multiple pivot tables on same sheet OOXML fix (part1), related #i83250#

This just fixes the generation of the pivot table file and the
relationship. It crashed in a dbgutil build because we tried to
overwrite the same stream for each pivot table on one sheet.

Change-Id: If2c9541e38b483ead75fff32d5f6d9e16970e702

diff --git a/sc/source/filter/excel/xepivot.cxx 
b/sc/source/filter/excel/xepivot.cxx
index e03cbf1..a0a00d6 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -1243,13 +1243,14 @@ void XclExpPTField::WriteSxvdex( XclExpStream rStrm ) 
const
 
 // 
 
-XclExpPivotTable::XclExpPivotTable( const XclExpRoot rRoot, const ScDPObject 
rDPObj, const XclExpPivotCache rPCache ) :
+XclExpPivotTable::XclExpPivotTable( const XclExpRoot rRoot, const ScDPObject 
rDPObj, const XclExpPivotCache rPCache, size_t nId ) :
 XclExpRoot( rRoot ),
 mrPCache( rPCache ),
 maDataOrientField( *this, EXC_SXIVD_DATA ),
 mnOutScTab( 0 ),
 mbValid( false ),
-mbFilterBtn( false )
+mbFilterBtn( false ),
+mnId( nId )
 {
 const ScRange rOutScRange = rDPObj.GetOutRange();
 if( GetAddressConverter().ConvertRange( maPTInfo.maOutXclRange, 
rOutScRange, true ) )
@@ -1352,8 +1353,8 @@ void XclExpPivotTable::SaveXml( XclExpXmlStream rStrm )
 if( !mbValid )
 return;
 sax_fastparser::FSHelperPtr aPivotTableDefinition = 
rStrm.CreateOutputStream(
-XclXmlUtils::GetStreamName( xl/, pivotTables/pivotTable, 
mnOutScTab+1),
-XclXmlUtils::GetStreamName( ../, pivotTables/pivotTable, 
mnOutScTab+1),
+XclXmlUtils::GetStreamName( xl/, pivotTables/pivotTable, mnId 
+ 1),
+XclXmlUtils::GetStreamName( ../, pivotTables/pivotTable, mnId 
+ 1),
 rStrm.GetCurrentStream()-getOutputStream(),
 
application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml,
 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable;);
@@ -1849,7 +1850,7 @@ void XclExpPivotTableManager::CreatePivotTables()
 for( size_t nDPObj = 0, nCount = pDPColl-GetCount(); nDPObj  nCount; 
++nDPObj )
 if( ScDPObject* pDPObj = (*pDPColl)[ nDPObj ] )
 if( const XclExpPivotCache* pPCache = CreatePivotCache( 
*pDPObj ) )
-maPTableList.AppendNewRecord( new XclExpPivotTable( 
GetRoot(), *pDPObj, *pPCache ) );
+maPTableList.AppendNewRecord( new XclExpPivotTable( 
GetRoot(), *pDPObj, *pPCache, nDPObj ) );
 }
 
 XclExpRecordRef XclExpPivotTableManager::CreatePivotCachesRecord()
diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx
index efcbbab..6f5a9a4 100644
--- a/sc/source/filter/inc/xepivot.hxx
+++ b/sc/source/filter/inc/xepivot.hxx
@@ -344,7 +344,7 @@ class XclExpPivotTable : public XclExpRecordBase, protected 
XclExpRoot
 {
 public:
 explicitXclExpPivotTable( const XclExpRoot rRoot,
-const ScDPObject rDPObj, const XclExpPivotCache 
rPCache );
+const ScDPObject rDPObj, const XclExpPivotCache 
rPCache, size_t nId );
 
 /** Returns a pivot cache field. */
 const XclExpPCField* GetCacheField( sal_uInt16 nCacheIdx ) const;
@@ -422,6 +422,7 @@ private:
 SCTAB   mnOutScTab; /// Sheet index of the output 
range.
 bool 

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

2014-02-17 Thread Markus Mohrhard
 oox/source/export/chartexport.cxx   |   63 +---
 sc/source/filter/excel/xestream.cxx |2 -
 2 files changed, 38 insertions(+), 27 deletions(-)

New commits:
commit b57bad8422c0efee8a42660806765f36746bb2fe
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Tue Feb 18 02:23:59 2014 +0100

the string is UTF8 and not Ascii

Change-Id: Ibf9a837ca5689ceae91eff2a081da3b7fe0b9244

diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 77c6295..30d774f 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -1016,7 +1016,7 @@ sax_fastparser::FSHelperPtr 
XclExpXmlStream::WriteAttributesInternal( sal_Int32
 rStream-write(   )
 -writeId( nAttribute )
 -write( =\ )
--writeEscaped( pValue )
+-writeEscaped( OUString(pValue, std::strlen(pValue), 
RTL_TEXTENCODING_UTF8) )
 -write( \ );
 }
 
commit 53146f93ad0697a7af8b312bfbe424c1066207a1
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

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index b427868..7fea8e3 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2801,6 +2801,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;
@@ -2814,12 +2829,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 ),
@@ -2871,7 +2880,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;
commit dd0c9e64835b825771d961b7a8f21f4d6c077fc7
Author: Markus Mohrhard markus.mohrh...@collabora.co.uk
Date:   Mon Feb 17 23:19:49 2014 +0100

fix indentation

Change-Id: I36be2de793d3d32433530bf71632cb73a676bb9a

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 337d510..b427868 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1851,36 +1851,36 @@ void ChartExport::exportCandleStickSeries(
 {
 Reference chart2::data::XDataSequence  xLabelSeq( 
xLabeledSeq-getLabel());
 Reference chart2::data::XDataSequence  xValueSeq( 
xLabeledSeq-getValues());
-{
-FSHelperPtr pFS = GetFS();
-pFS-startElement( FSNS( XML_c, XML_ser ),
+{
+FSHelperPtr pFS = GetFS();
+pFS-startElement( FSNS( XML_c, XML_ser ),
 FSEND );
 
-// TODO: idx and order
-// idx attribute should start from 1 and not from 
0.
-pFS-singleElement( FSNS( XML_c, XML_idx ),
+// TODO: idx and order
+// idx attribute should start from 1 and not from 0.
+pFS-singleElement( FSNS( XML_c, XML_idx ),
 XML_val, I32S(idx+1),
   

[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa

2014-01-20 Thread Miklos Vajna
 oox/source/export/drawingml.cxx  |   14 +-
 oox/source/export/shapes.cxx |5 -
 sw/qa/extras/ooxmlexport/data/dml-textshape.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |   16 
 4 files changed, 33 insertions(+), 2 deletions(-)

New commits:
commit 106c82706edc1adc2df8d39d332fd3a3452c5d78
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 20 11:19:01 2014 +0100

drawingML export: write TextShape outline properties

Change-Id: I3742c960016bbe1d82b58a16d464b329d2612c10

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 37faad5..e55c2f3 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -936,6 +936,7 @@ ShapeExport ShapeExport::WriteTextShape( Reference XShape 
 xShape )
 WritePresetShape( rect );
 uno::Referencebeans::XPropertySet xPropertySet(xShape, UNO_QUERY);
 WriteFill(xPropertySet);
+WriteOutline(xPropertySet);
 WriteBlipFill(xPropertySet, GraphicURL);
 pFS-endElementNS( mnXmlNamespace, XML_spPr );
 
diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx 
b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx
new file mode 100644
index 000..e5be42c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 56d6acb..8d01930 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2469,6 +2469,22 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, 
mso-spt180.docx)
 CPPUNIT_ASSERT_EQUAL(OUString(ooxml-borderCallout1), aType);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, dml-textshape.docx)
+{
+uno::Referencecontainer::XIndexAccess xGroup(getShape(1), 
uno::UNO_QUERY);
+uno::Referencedrawing::XShape xShape(xGroup-getByIndex(1), 
uno::UNO_QUERY);
+// This was drawing::FillStyle_NONE.
+CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, 
getPropertydrawing::FillStyle(xShape, FillStyle));
+// This was drawing::LineStyle_NONE.
+CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, 
getPropertydrawing::LineStyle(xShape, LineStyle));
+
+xmlDocPtr pXmlDocument = parseExport(word/document.xml);
+if (!pXmlDocument)
+return;
+// This was wrap=none.
+assertXPath(pXmlDocument, 
/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:bodyPr,
 wrap, square);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, 
shape-theme-preservation.docx)
 {
 xmlDocPtr pXmlDocument = parseExport(word/document.xml);
commit 2d4f0a7d0dd3da34d054ff444e69b10ef015e260
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 20 11:16:24 2014 +0100

drawingML export: fix TextShape width for DOCX

Change-Id: Ibaf29ed746076fa6ec0bad013cac26debdb2b165

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6c03b22..2a7d11a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1396,8 +1396,19 @@ void DrawingML::WriteText( Reference XInterface  
rXIface, bool bBodyPr, bool b
 }
 
 if (bBodyPr)
+{
+const char* pWrap = bHasWrap  !bWrap ? none : NULL;
+if (GetDocumentType() == DOCUMENT_DOCX)
+{
+// In case of DOCX, if we want to have the same effect as
+// TextShape's automatic word wrapping, then we need to set
+// wrapping to square.
+uno::Referencelang::XServiceInfo xServiceInfo(rXIface, 
uno::UNO_QUERY);
+if (xServiceInfo.is()  
xServiceInfo-supportsService(com.sun.star.drawing.TextShape))
+pWrap = square;
+}
 mpFS-singleElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), 
XML_bodyPr,
-   XML_wrap, bHasWrap  !bWrap ? none : NULL,
+   XML_wrap, pWrap,
XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( 
nLeft ) ) : NULL,
XML_rIns, (nRight != DEFLRINS) ? IS( 
MM100toEMU( nRight ) ) : NULL,
XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( 
nTop ) ) : NULL,
@@ -1406,6 +1417,7 @@ void DrawingML::WriteText( Reference XInterface  
rXIface, bool bBodyPr, bool b
XML_anchorCtr, bHorizontalCenter ? 1 : NULL,
XML_vert, sWritingMode,
FSEND );
+}
 
 Reference XEnumerationAccess  access( xXText, UNO_QUERY );
 if( !access.is() || !bText )
commit 243ce7d73acc070194ecf5bb9f97b8a7cbf87ecd
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 20 10:23:29 2014 +0100

drawingML export: write TextShape fill properties

Change-Id: Ibe89e86b19d7633e9a0669ff0574173ac4b633c5

diff --git 

[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa

2014-01-02 Thread Miklos Vajna
 oox/source/export/shapes.cxx |   66 +++
 sw/qa/extras/ooxmlexport/data/bezier.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |8 +++
 3 files changed, 50 insertions(+), 24 deletions(-)

New commits:
commit 3a45a4e80257d8737df4dda0b2d85f602196a70d
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jan 2 11:58:57 2014 +0100

oox: fix export of TextShapes in DOCX

This was the last shape type that unconditionally wrote XML_sp for the
shape element, which is invalid for DOCX.

Change-Id: I3a6f8e6fd8ebbe663dce9ed4453396c3ec91c38a

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 59af378..67cf3dc 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -905,14 +905,20 @@ ShapeExport ShapeExport::WriteTextShape( Reference 
XShape  xShape )
 {
 FSHelperPtr pFS = GetFS();
 
-pFS-startElementNS( mnXmlNamespace, XML_sp, FSEND );
+pFS-startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? 
XML_sp : XML_wsp), FSEND );
 
 // non visual shape properties
-pFS-startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
-WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) );
+if (GetDocumentType() != DOCUMENT_DOCX)
+{
+pFS-startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) );
+}
 pFS-singleElementNS( mnXmlNamespace, XML_cNvSpPr, XML_txBox, 1, FSEND );
-WriteNonVisualProperties( xShape );
-pFS-endElementNS( mnXmlNamespace, XML_nvSpPr );
+if (GetDocumentType() != DOCUMENT_DOCX)
+{
+WriteNonVisualProperties( xShape );
+pFS-endElementNS( mnXmlNamespace, XML_nvSpPr );
+}
 
 // visual shape properties
 pFS-startElementNS( mnXmlNamespace, XML_spPr, FSEND );
@@ -923,7 +929,7 @@ ShapeExport ShapeExport::WriteTextShape( Reference XShape 
 xShape )
 
 WriteTextBox( xShape, mnXmlNamespace );
 
-pFS-endElementNS( mnXmlNamespace, XML_sp );
+pFS-endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? 
XML_sp : XML_wsp) );
 
 return *this;
 }
diff --git a/sw/qa/extras/ooxmlexport/data/bezier.odt 
b/sw/qa/extras/ooxmlexport/data/bezier.odt
new file mode 100644
index 000..c73ed3e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bezier.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 187cf4f..54042d4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2175,6 +2175,14 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, 
relorientation.docx)
 CPPUNIT_ASSERT_EQUAL(OUString(com.sun.star.drawing.GroupShape), 
xShapeDescriptor-getShapeType());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testBezier, bezier.odt)
+{
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xDraws(xDrawPageSupplier-getDrawPage(), uno::UNO_QUERY);
+// Check that no shape got lost: a bezier, a line and a text shape.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDraws-getCount());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, 
testTrackChangesDeletedParagraphMark.docx)
 {
 xmlDocPtr pXmlDoc = parseExport(word/document.xml);
commit affcea4185ffa95385cfb74ca68fa31361d6784b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jan 2 11:56:39 2014 +0100

oox: fix export of LineShapes in DOCX

Change-Id: I7b6f4616d450d2cffa58217db2ef250f5b8d9cba

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index a26da94..59af378 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -615,7 +615,7 @@ ShapeExport ShapeExport::WriteLineShape( Reference XShape 
 xShape )
 
 FSHelperPtr pFS = GetFS();
 
-pFS-startElementNS( mnXmlNamespace, XML_sp, FSEND );
+pFS-startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? 
XML_sp : XML_wsp), FSEND );
 
 PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape 
);
 if( aPolyPolygon.Count() == 1  aPolyPolygon[ 0 ].GetSize() == 2)
@@ -627,14 +627,20 @@ ShapeExport ShapeExport::WriteLineShape( Reference 
XShape  xShape )
 }
 
 // non visual shape properties
-pFS-startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
-pFS-singleElementNS( mnXmlNamespace, XML_cNvPr,
-  XML_id, I32S( GetNewShapeID( xShape ) ),
-  XML_name, IDS( Line ),
-  FSEND );
+if (GetDocumentType() != DOCUMENT_DOCX)
+{
+pFS-startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND );
+pFS-singleElementNS( mnXmlNamespace, XML_cNvPr,
+  XML_id, I32S( GetNewShapeID( xShape ) ),
+  XML_name, IDS( Line ),
+  FSEND );
+}
 

[Libreoffice-commits] core.git: 3 commits - oox/source sd/qa

2013-11-13 Thread Muthu Subramanian
 oox/source/export/drawingml.cxx |   13 +
 sd/qa/unit/import-tests.cxx |   21 -
 sd/qa/unit/sdmodeltestbase.hxx  |   32 
 3 files changed, 57 insertions(+), 9 deletions(-)

New commits:
commit 08a52b17cb2e8c4c2a8c1ad7b95d2cfc5a9e844e
Author: Muthu Subramanian sumu...@collabora.com
Date:   Wed Nov 13 20:54:46 2013 +0530

n#828390: Export subscript text.

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 7a75d88..3f5731b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -697,6 +697,7 @@ void DrawingML::WriteRunProperties( Reference XPropertySet 
 rRun, sal_Bool bIs
 const char* italic = NULL;
 const char* underline = NULL;
 sal_Int32 nSize = 1800;
+sal_Int32 nCharEscapement = 0;
 
 if( GETAD( CharHeight ) )
 nSize = (sal_Int32) (100*(*((float*) mAny.getValue(;
@@ -777,12 +778,24 @@ void DrawingML::WriteRunProperties( Reference 
XPropertySet  rRun, sal_Bool bIs
 usLanguage = aLanguageTag.getBcp47();
 }
 
+if( GETAD( CharEscapement ) )
+mAny = nCharEscapement;
+
+if( nCharEscapement  GETAD( CharEscapementHeight ) ) {
+sal_uInt32 nCharEscapementHeight;
+mAny = nCharEscapementHeight;
+nSize = (nSize * nCharEscapementHeight) / 100;
+// MSO uses default ~58% size
+nSize = (nSize / 0.58);
+}
+
 mpFS-startElementNS( XML_a, XML_rPr,
   XML_b, bold,
   XML_i, italic,
   XML_lang, usLanguage.isEmpty() ? NULL : USS( 
usLanguage ),
   XML_sz, nSize == 1800 ? NULL : IS( nSize ),
   XML_u, underline,
+  XML_baseline, nCharEscapement == 0 ? NULL : IS( 
nCharEscapement*1000 ),
   FSEND );
 
 // mso doesn't like text color to be placed after typeface
commit 5656393f02ddd501d60673b0686688156336f0ee
Author: Muthu Subramanian sumu...@collabora.com
Date:   Wed Nov 13 20:45:18 2013 +0530

Add export unit test helper to testDocumentLayout.

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 2a7de2d..6862815 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -88,16 +88,17 @@ the test, and re-running; it should break.
 */
 void SdFiltersTest::testDocumentLayout()
 {
-struct { const char *pInput, *pDump; } aFilesToCompare[] =
+struct { const char *pInput, *pDump; sal_Int32 nExportType; } 
aFilesToCompare[] =
 {
-{ odp/shapes-test.odp, xml/shapes-test_page },
-{ pptx/fdo47434-all.pptx, pptx/xml/fdo47434_page },
-{ n758621.ppt, xml/n758621_ },
-{ fdo64586.ppt, xml/fdo64586_ },
-{ n819614.pptx, xml/n819614_ },
-{ n820786.pptx, xml/n820786_ },
-{ n762695.pptx, xml/n762695_ },
-{ n593612.pptx, xml/n593612_ },
+{ odp/shapes-test.odp, xml/shapes-test_page, -1 },
+{ pptx/fdo47434-all.pptx, pptx/xml/fdo47434_page, -1 },
+{ n758621.ppt, xml/n758621_, -1 },
+{ fdo64586.ppt, xml/fdo64586_, -1 },
+{ n819614.pptx, xml/n819614_, -1 },
+{ n820786.pptx, xml/n820786_, -1 },
+{ n762695.pptx, xml/n762695_, -1 },
+{ n593612.pptx, xml/n593612_, -1 },
+// { pptx/n828390.pptx, pptx/xml/n828390_, PPTX }, // Example
 };
 
 for ( int i = 0; i  static_cast int ( SAL_N_ELEMENTS( aFilesToCompare ) 
); ++i )
@@ -105,6 +106,8 @@ void SdFiltersTest::testDocumentLayout()
 int nUpdateMe = -1; // index of test we want to update; supposedly 
only when the test is created
 
 ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc( 
/sd/qa/unit/data/ ) + OUString::createFromAscii( aFilesToCompare[i].pInput ) 
);
+if( aFilesToCompare[i].nExportType = 0 )
+xDocShRef = saveAndReload( xDocShRef, 
aFilesToCompare[i].nExportType );
 compareWithShapesDump( xDocShRef,
 getPathFromSrc( /sd/qa/unit/data/ ) + 
OUString::createFromAscii( aFilesToCompare[i].pDump ),
 i == nUpdateMe );
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 6c05ffa..00b5892 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -120,10 +120,10 @@ protected:
 return xDocShRef;
 }
 
-::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_uLong 
nExportType )
+::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_Int32 
nExportType )
 {
 FileFormat *pFmt = aFileFormats[0];
-if( nExportType  SAL_N_ELEMENTS( aFileFormats ) )
+if( ( (sal_uInt32) nExportType )  SAL_N_ELEMENTS( aFileFormats ) )
 pFmt = aFileFormats[ nExportType ];
 OUString aExt = OUString( . ) + OUString::createFromAscii( 
pFmt-pName );
 utl::TempFile aTempFile( OUString(), aExt );

[Libreoffice-commits] core.git: 3 commits - oox/source writerfilter/source xmloff/source

2013-05-02 Thread Luboš Luňák
 oox/source/vml/vmldrawing.cxx|3 
 writerfilter/source/dmapper/NumberingManager.cxx |   19 
 writerfilter/source/dmapper/NumberingManager.hxx |4 
 writerfilter/source/dmapper/PropertyIds.cxx  |1 
 writerfilter/source/dmapper/PropertyIds.hxx  |1 
 xmloff/source/style/xmlnume.cxx  |   76 +-
 xmloff/source/style/xmlnumi.cxx  |   96 ++-
 7 files changed, 75 insertions(+), 125 deletions(-)

New commits:
commit f13f3b42eb113ead6fcffba39e8fcfb31808627d
Author: Luboš Luňák l.lu...@suse.cz
Date:   Mon Apr 29 16:10:00 2013 +0200

place ooxml shapes properly to paragraph area (part of bnc#816583)

style=position:absolute;left:0 is relative to paragraph area,
not paragraph text area (which is different if it's indented).

Change-Id: I12a1d2b8a68aa3fa9c65b3d469118b5334f83d7f

diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 88282dd..8a68bd7 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -25,6 +25,7 @@
 #include com/sun/star/drawing/XShapes.hpp
 #include com/sun/star/lang/XMultiServiceFactory.hpp
 #include com/sun/star/text/HoriOrientation.hpp
+#include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/VertOrientation.hpp
 #include rtl/ustring.hxx
 #include oox/core/xmlfilterbase.hxx
@@ -228,6 +229,8 @@ Reference XShape  Drawing::createAndInsertXShape( const 
OUString rService,
 xPropSet-setPropertyValue( OUString::createFromAscii( 
VertOrient ), makeAny( VertOrientation::NONE ) );
 xPropSet-setPropertyValue( OUString::createFromAscii( 
HoriOrientPosition ), makeAny( rShapeRect.X ) );
 xPropSet-setPropertyValue( OUString::createFromAscii( 
VertOrientPosition ), makeAny( rShapeRect.Y ) );
+xPropSet-setPropertyValue( OUString::createFromAscii( 
HoriOrientRelation ), makeAny( RelOrientation::FRAME ) );
+xPropSet-setPropertyValue( OUString::createFromAscii( 
VertOrientRelation ), makeAny( RelOrientation::FRAME ) );
 }
 xShape-setSize( awt::Size( rShapeRect.Width, rShapeRect.Height ) );
 }
commit 7dfc4da808bb26d38090f8afb0d742adabe8cedf
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Apr 26 21:30:39 2013 +0200

handle graphic bullets in .docx also when saved as w:pict

Change-Id: I7225b4b024c6b7c549d0c9fbf5204df653577bec

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 3c6019d..87ddf75 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -278,7 +278,7 @@ uno::Sequence beans::PropertyValue  
ListLevel::GetLevelProperties( )
 sal_Int16 nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC);
 if( m_nNFC = 0)
 {
-if (!m_sGraphicURL.isEmpty())
+if (!m_sGraphicURL.isEmpty() || m_sGraphicBitmap.is())
 nNumberFormat = style::NumberingType::BITMAP;
 aNumberingProperties.push_back( MAKE_PROPVAL(PROP_NUMBERING_TYPE, 
nNumberFormat ));
 }
@@ -293,6 +293,8 @@ uno::Sequence beans::PropertyValue  
ListLevel::GetLevelProperties( )
 aNumberingProperties.push_back( MAKE_PROPVAL(PROP_BULLET_CHAR, 
m_sBulletChar.copy(0,1)));
 if (!m_sGraphicURL.isEmpty())
 aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_URL, 
m_sGraphicURL));
+if (m_sGraphicBitmap.is())
+aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_BITMAP, 
m_sGraphicBitmap));
 }
 
 aNumberingProperties.push_back( MAKE_PROPVAL( PROP_LISTTAB_STOP_POSITION, 
m_nTabstop ) );
@@ -931,7 +933,20 @@ void ListsManager::lcl_sprm( Sprm rSprm )
 if (xShape.is())
 {
 uno::Referencebeans::XPropertySet xPropertySet(xShape, 
uno::UNO_QUERY);
-
m_pCurrentDefinition-GetCurrentLevel()-SetGraphicURL(xPropertySet-getPropertyValue(GraphicURL).getOUString());
+uno::Referencebeans::XPropertySetInfo info = 
xPropertySet-getPropertySetInfo();
+uno::Sequencebeans::Property properties = 
info-getProperties();
+try
+{
+
m_pCurrentDefinition-GetCurrentLevel()-SetGraphicURL(xPropertySet-getPropertyValue(GraphicURL).getOUString());
+} catch(const beans::UnknownPropertyException)
+{}
+try
+{
+uno::Reference graphic::XGraphic  gr;
+xPropertySet-getPropertyValue(Bitmap) = gr;
+
m_pCurrentDefinition-GetCurrentLevel()-SetGraphicBitmap( gr );
+} catch(const beans::UnknownPropertyException)
+{}
 
 // Now that we saved the URL of the graphic, remove it 
from the 

[Libreoffice-commits] core.git: 3 commits - oox/source

2013-04-29 Thread Markus Mohrhard
 oox/source/export/chartexport.cxx |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 81b9d431678bc270e7592e9bedb81d2d445e2122
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 29 16:33:24 2013 +0200

c:varyColor is true by default in Excel

And another step closer to opening my test file correctly in Excel.

Change-Id: Ib6aa8ddb2f2792513c7263d86865e08fe5f1483d

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index d0895f3..98fff6f 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1330,6 +1330,10 @@ void ChartExport::exportScatterChart( Reference 
chart2::XChartType  xChartType
 XML_val, scatterStyle,
 FSEND );
 
+pFS-singleElement( FSNS( XML_c, XML_varyColors ),
+XML_val, 0,
+FSEND );
+
 // FIXME: should export xVal and yVal
 sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
 exportSeries( xChartType, nAttachedAxis );
commit 5c19f86a077622141560bdba97e94136db9e9b40
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 29 16:13:21 2013 +0200

OSL_TRACE = SAL_WARN in chartexport.cxx

Change-Id: I12ddd18c1b4476d42c097704c2af2d0af4e15a1e

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index e616922..d0895f3 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2311,9 +2311,7 @@ void ChartExport::exportDataLabels(
 }
 catch( const uno::Exception  rEx )
 {
-(void)rEx; // avoid warning for pro build
-OSL_TRACE( Exception caught during Export of data label: %s,
-OUStringToOString( rEx.Message, 
RTL_TEXTENCODING_ASCII_US ).getStr() );
+SAL_WARN(oox, Exception caught during Export of data label: 
  rEx.Message );
 }
 
 if( xPropSet.is() )
commit 6ddd7fccdc8fc292200e581dbc4e456ec86cef47
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 29 16:12:33 2013 +0200

c:delete is true by default in Excel

One step closer to opening my simple test file correctly in Excel.

Change-Id: I1bfa76a46081ba478e44d8d90d8a91790a9a9ff3

diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index c3cf09f..e616922 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2085,13 +2085,9 @@ void ChartExport::_exportAxis(
 OUString (Visible)) =  bVisible;
 }
 
-if( !bVisible )
-{
-// other value?
-pFS-singleElement( FSNS( XML_c, XML_delete ),
-XML_val, 1,
+pFS-singleElement( FSNS( XML_c, XML_delete ),
+XML_val, bVisible ? 0 : 1,
 FSEND );
-}
 
 // FIXME: axPos, need to check the property ReverseDirection
 pFS-singleElement( FSNS( XML_c, XML_axPos ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits