[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/xmloff xmloff/source

2018-05-20 Thread Caolán McNamara
 include/xmloff/xmlimp.hxx   |2 +-
 xmloff/source/core/xmlictxt.cxx |6 +++---
 xmloff/source/core/xmlimp.cxx   |   10 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 3e50044ba41410b9f6a6879f71cdb8314a6d56c3
Author: Caolán McNamara 
Date:   Wed Apr 11 12:31:36 2018 +0100

crashtesting: assert on fdo62508-1.odt

document, with meta:generator of "opxml2odf - Version KO 0.1" has
a styles.xml xmlns of...

xmlns:ofo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"

instead of the usual xmlns:fo=...

use the importer namespace map to get the importers namespace prefix
for the fastparser namespace uri for the token

Change-Id: Ib633009f6c2b7dae5a3ceb1c921adfff84e21150
Reviewed-on: https://gerrit.libreoffice.org/52720
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/54548
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index b6552a297843..642c5b2e652b 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -376,7 +376,7 @@ public:
 XMLEventImportHelper& GetEventImport();
 
 static const OUString getNameFromToken( sal_Int32 nToken );
-static const OUString getNamespacePrefixFromToken( sal_Int32 nToken );
+static const OUString getNamespacePrefixFromToken(sal_Int32 nToken, const 
SvXMLNamespaceMap* pMap);
 
 SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; }
 const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; 
}
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx
index cc5f46ce0c48..832cd5a2c7bf 100644
--- a/xmloff/source/core/xmlictxt.cxx
+++ b/xmloff/source/core/xmlictxt.cxx
@@ -70,7 +70,7 @@ void SvXMLImportContext::Characters( const OUString& )
 void SAL_CALL SvXMLImportContext::startFastElement(sal_Int32 nElement, const 
uno::Reference< xml::sax::XFastAttributeList > & Attribs)
 {
 mrImport.isFastContext = false;
-startUnknownElement( SvXMLImport::getNamespacePrefixFromToken( nElement ),
+startUnknownElement( SvXMLImport::getNamespacePrefixFromToken(nElement, 
&GetImport().GetNamespaceMap()),
  SvXMLImport::getNameFromToken( nElement ), Attribs );
 }
 
@@ -99,7 +99,7 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const 
OUString & rPrefix,
 for( auto &it : *pAttribList )
 {
 sal_Int32 nToken = it.getToken();
-const OUString& rAttrNamespacePrefix = 
SvXMLImport::getNamespacePrefixFromToken( nToken );
+const OUString& rAttrNamespacePrefix = 
SvXMLImport::getNamespacePrefixFromToken(nToken, 
&GetImport().GetNamespaceMap());
 OUString sAttrName = SvXMLImport::getNameFromToken( nToken );
 if ( !rAttrNamespacePrefix.isEmpty() )
 sAttrName = rAttrNamespacePrefix + ":" + sAttrName;
@@ -129,7 +129,7 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const 
OUString & rPrefix,
 void SAL_CALL SvXMLImportContext::endFastElement(sal_Int32 nElement)
 {
 mrImport.isFastContext = false;
-endUnknownElement( SvXMLImport::getNamespacePrefixFromToken( nElement ),
+endUnknownElement( SvXMLImport::getNamespacePrefixFromToken(nElement, 
&GetImport().GetNamespaceMap()),
SvXMLImport::getNameFromToken( nElement ) );
 }
 
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index af7a0788bf02..310fae5fc9bb 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -2038,12 +2038,20 @@ const OUString SvXMLImport::getNameFromToken( sal_Int32 
nToken )
 aSeq.getConstArray() ), aSeq.getLength(), 
RTL_TEXTENCODING_UTF8 );
 }
 
-const OUString SvXMLImport::getNamespacePrefixFromToken( sal_Int32 nToken )
+const OUString SvXMLImport::getNamespacePrefixFromToken(sal_Int32 nToken, 
const SvXMLNamespaceMap* pMap)
 {
 sal_Int32 nNamespaceToken = ( nToken & NMSP_MASK ) >> NMSP_SHIFT;
 auto aIter( aNamespaceMap.find( nNamespaceToken ) );
 if( aIter != aNamespaceMap.end() )
+{
+if (pMap)
+{
+OUString sRet = 
pMap->GetPrefixByKey(pMap->GetKeyByName((*aIter).second.second));
+if (!sRet.isEmpty())
+return sRet;
+}
 return (*aIter).second.first;
+}
 else
 return OUString();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/xmloff xmloff/source

2018-02-28 Thread Julien Nabet
 include/xmloff/xmltoken.hxx |1 +
 xmloff/source/core/xmltoken.cxx |1 +
 xmloff/source/token/tokens.txt  |1 +
 3 files changed, 3 insertions(+)

New commits:
commit 4b29ee6a6a5620610de816b27dccd9c0121e49be
Author: Julien Nabet 
Date:   Mon Feb 5 14:07:06 2018 +0100

tdf#115429: declare fill-rule

Change-Id: I5eb93d08b1dd56db19038132b560ddf7ba174bc6
Reviewed-on: https://gerrit.libreoffice.org/49242
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 5222383c29d190218108c7c9e362a5a55af73a2f)
Reviewed-on: https://gerrit.libreoffice.org/50480

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 175187ae6897..72d8d034a403 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -777,6 +777,7 @@ namespace xmloff { namespace token {
 XML_FILL_IMAGE_REF_POINT_X,
 XML_FILL_IMAGE_REF_POINT_Y,
 XML_FILL_IMAGE_WIDTH,
+XML_FILL_RULE,
 XML_FILTER,
 XML_FILTER_AND,
 XML_FILTER_CONDITION,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 3d33a489493a..e1e67af750b6 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -777,6 +777,7 @@ namespace xmloff { namespace token {
 TOKEN( "fill-image-ref-point-x",  XML_FILL_IMAGE_REF_POINT_X ),
 TOKEN( "fill-image-ref-point-y",  XML_FILL_IMAGE_REF_POINT_Y ),
 TOKEN( "fill-image-width",XML_FILL_IMAGE_WIDTH ),
+TOKEN( "fill-rule",   XML_FILL_RULE ),
 TOKEN( "filter",  XML_FILTER ),
 TOKEN( "filter-and",  XML_FILTER_AND ),
 TOKEN( "filter-condition",XML_FILTER_CONDITION ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 4e58356c7c07..cc0b35ad084c 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -700,6 +700,7 @@ fill-image-ref-point
 fill-image-ref-point-x
 fill-image-ref-point-y
 fill-image-width
+fill-rule
 filter
 filter-and
 filter-condition
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/xmloff

2018-02-19 Thread Stephan Bergmann
 include/xmloff/settingsstore.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7132ffcefe3110a9e65fe990891c1a262508a41a
Author: Stephan Bergmann 
Date:   Fri Feb 16 23:15:56 2018 +0100

DocumentSettingsSerializer must be SAL_DLLPUBLIC_RTTI for dynamic_cast

...in SdXMLImport::SetConfigurationSettings 
(xmloff/source/draw/sdxmlimp.cxx) to
work with instances of sd::DocumentSettings (defined in
sd/source/ui/unoidl/UnoDocumentSettings.cxx, derived from
DocumentSettingsSerializer), at least on platforms using the strict 
by-address
RTTI equality check form (e.g., macOS).

(Cross-casts like this are not detected by loplugin:dyncastvisibility.)

Change-Id: I3f8712f9c64852cc8cb17c0c25211963360f117c
Reviewed-on: https://gerrit.libreoffice.org/49884
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 
(cherry picked from commit ff570b4b58dbf274d3094d21d974f18b613e9b4b)
Reviewed-on: https://gerrit.libreoffice.org/49928
Reviewed-by: Michael Stahl 

diff --git a/include/xmloff/settingsstore.hxx b/include/xmloff/settingsstore.hxx
index e78ae0a82ca3..0878a5ec288f 100644
--- a/include/xmloff/settingsstore.hxx
+++ b/include/xmloff/settingsstore.hxx
@@ -18,7 +18,7 @@
 
 // Scans list of properties for certain URL properties that could refer
 // to internal objects, and initializes from these.
-class DocumentSettingsSerializer {
+class SAL_DLLPUBLIC_RTTI DocumentSettingsSerializer {
 public:
   // Import objects and update properties (eliding URLs)
   virtual css::uno::Sequence
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/xmloff xmloff/source

2018-01-11 Thread Armin Le Grand
 include/xmloff/txtparae.hxx|6 ++
 xmloff/source/text/XMLTextFrameContext.cxx |   57 ++-
 xmloff/source/text/txtparae.cxx|   87 -
 3 files changed, 120 insertions(+), 30 deletions(-)

New commits:
commit d45631314cef8a538900800561b435202917
Author: Armin Le Grand 
Date:   Wed Jan 10 18:13:41 2018 +0100

RotateFlyFrameFix: Add RotCenter info to ODF export

Since the WriterFlyFrames are implicitly rotated around
their center in the Writer UI this has to be added to the
transformation in ODF expressing this. The saved data
now contains the shape data in svg:x/y/width/height statements
(and thus back-compatible AFAP) and a draw:transform statement
(that is to be applied to the defined shape) containing the
rotation around the object's center.

Change-Id: Iccfc70924364f1d58995fce180bce9b6e7643ff4
Reviewed-on: https://gerrit.libreoffice.org/47742
Tested-by: Jenkins 
Reviewed-by: Armin Le Grand 

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index c62a25d0b6f3..6e65e1082e03 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -64,6 +64,11 @@ namespace xmloff
 
 }
 
+namespace basegfx
+{
+class B2DPoint;
+}
+
 enum class TextPNS
 {
 ODF,
@@ -253,6 +258,7 @@ protected:
 XMLShapeExportFlags addTextFrameAttributes(
 const css::uno::Reference< css::beans::XPropertySet >& rPropSet,
 bool bShape,
+basegfx::B2DPoint* pCenter = nullptr,
 OUString *pMinHeightValue = nullptr,
 OUString *pMinWidthValue = nullptr );
 
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index 7aed805e47dc..14107cf65e65 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -982,23 +982,50 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
 break;
 case XML_TOK_TEXT_FRAME_TRANSFORM:
 {
-OUString sValue( rValue );
-sValue = sValue.trim();
-const OUString& aRotate(GetXMLToken(XML_ROTATE));
-const sal_Int32 nRotateLen(aRotate.getLength());
-sal_Int32 nLen = sValue.getLength();
-if( nLen >= nRotateLen+3 &&
-sValue.startsWith(aRotate) &&
-'(' == sValue[nRotateLen] &&
-')' == sValue[nLen-1] )
+// RotateFlyFrameFix: im/export full 'draw:transform' using 
existing tooling
+// Currently only rotation is used, but combinations with 
'draw:transform'
+// may be necessary in the future, so that 
svg:x/svg:y/svg:width/svg:height
+// may be extended/replaced with 'draw:transform' (see draw 
objects)
+SdXMLImExTransform2D aSdXMLImExTransform2D;
+basegfx::B2DHomMatrix aFullTransform;
+
+// Use SdXMLImExTransform2D to convert to transformation
+// Note: using GetTwipUnitConverter instead of 
GetMM100UnitConverter may be needed,
+// but is not generally available (as it should be, a 
'current' UnitConverter should
+// be available at GetExport() - and maybe was once). May have 
to be addressed as soon
+// as translate transformations are used here.
+aSdXMLImExTransform2D.SetString(rValue, 
GetImport().GetMM100UnitConverter());
+aSdXMLImExTransform2D.GetFullTransform(aFullTransform);
+
+if(!aFullTransform.isIdentity())
 {
-sValue = sValue.copy( nRotateLen+1, nLen-(nRotateLen+2) );
-sValue = sValue.trim();
-sal_Int32 nVal;
-if (::sax::Converter::convertNumber( nVal, sValue ))
+const basegfx::utils::B2DHomMatrixBufferedDecompose 
aDecomposedTransform(aFullTransform);
+
+// currently we *only* use rotation (and translation 
indirectly), so warn if *any*
+// of the other transform parts is used
+SAL_WARN_IF(!basegfx::fTools::equal(1.0, 
aDecomposedTransform.getScale().getX()), "xmloff.text", "draw:transform uses 
scaleX" );
+SAL_WARN_IF(!basegfx::fTools::equal(1.0, 
aDecomposedTransform.getScale().getY()), "xmloff.text", "draw:transform uses 
scaleY" );
+
SAL_WARN_IF(!basegfx::fTools::equalZero(aDecomposedTransform.getShearX()), 
"xmloff.text", "draw:transform uses shearX" );
+
+// Translation comes from the translate to RotCenter, rot 
and BackTranslate.
+// This means that it represents the translation between 
unrotated TopLeft
+// and rotated TopLeft. This may be checked here now, but 
currently we only
+// use rotation around cen