[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - xmloff/source

2016-05-25 Thread Laurent Balland-Poirier
 xmloff/source/style/xmlnumfi.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1f599fb158d5a94128e9eb28b6787f5116df9e8b
Author: Laurent Balland-Poirier 
Date:   Wed May 4 22:16:47 2016 +0200

tdf#38097 min numerator/denominator at least 1

In  attributes min-denominator-digits and
min-numerator-digits should be at least 1.
Gnumeric can create file with 0 values

Change-Id: I08ef51c23ce686136f51277671bf630807353484
Reviewed-on: https://gerrit.libreoffice.org/24670
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit a75aa73b2bf793faac1adb3b5f67e09d252d5fe9)
Reviewed-on: https://gerrit.libreoffice.org/25449
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index bb8f97f..9aac01e 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -973,11 +973,11 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( 
SvXMLImport& rImport,
 aNumInfo.bExpSign = bAttrBool;
 break;
 case XML_TOK_ELEM_ATTR_MIN_NUMERATOR_DIGITS:
-if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))
+if (::sax::Converter::convertNumber( nAttrVal, sValue, 1 ))  
// at least one '?' (tdf#38097)
 aNumInfo.nNumerDigits = nAttrVal;
 break;
-case XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS:
-if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))
+case XML_TOK_ELEM_ATTR_MIN_DENOMINATOR_DIGITS:  // while 
max-denominator-digits not treated (tdf#99661)
+if (::sax::Converter::convertNumber( nAttrVal, sValue, 1 ))  
// at least one '?' (tdf#38097)
 aNumInfo.nDenomDigits = nAttrVal;
 break;
 case XML_TOK_ELEM_ATTR_DENOMINATOR_VALUE:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - xmloff/source

2016-04-26 Thread Stephan Bergmann
 xmloff/source/core/xmlmultiimagehelper.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit e153df58650cc7eb7a87de03d7228dbbaffdfcfb
Author: Stephan Bergmann 
Date:   Wed Jan 13 17:29:51 2016 +0100

-Werror=address

the original looks odd, but the code was like that ever since it got 
introduced
with 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70 "re-base on ALv2 code. 
Includes
(at least) relevant parts of:"

Change-Id: I327c5a53a2634aca1b36367ee09c068ac610d3f4
(cherry picked from commit 09f1bd85d432d130cd54d329d01a020728757c2e)
Signed-off-by: David Tardon 
Reviewed-on: https://gerrit.libreoffice.org/24406
Tested-by: Jenkins 

diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx 
b/xmloff/source/core/xmlmultiimagehelper.cxx
index 9a6711f..e7eeb62 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -136,10 +136,7 @@ SvXMLImportContextRef 
MultiImageImportHelper::solveMultipleImages()
 
 void MultiImageImportHelper::addContent(const SvXMLImportContext& 
rSvXMLImportContext)
 {
-if(dynamic_cast< const SvXMLImportContext* >())
-{
-maImplContextVector.push_back(SvXMLImportContextRef(const_cast< 
SvXMLImportContext* >()));
-}
+maImplContextVector.push_back(SvXMLImportContextRef(const_cast< 
SvXMLImportContext* >()));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - xmloff/source

2016-01-20 Thread Laurent Balland-Poirier
 xmloff/source/style/xmlnumfe.cxx |   16 ++--
 xmloff/source/style/xmlnumfi.cxx |   19 +--
 2 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit 50a3c6b2f3b849885580b304929eabe4a71b9162
Author: Laurent Balland-Poirier 
Date:   Wed Dec 30 23:32:15 2015 +0100

tdf#40517 Export/Import in ODF decimal replacement with space

Number format such as "0.???" is saved in ODF with 
number:decimal-replacement=" "

Change-Id: I0dd19b5ea126f380bcf17a3ccc5d8c355119e23b
Reviewed-on: https://gerrit.libreoffice.org/21021
Tested-by: Jenkins 
Reviewed-by: jan iversen 
(cherry picked from commit 3ee66e306cf0ca9c2b56de26c28e8130d7b72f64)
Reviewed-on: https://gerrit.libreoffice.org/21613
Tested-by: jan iversen 

diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 136c3d2..41c549d 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1179,6 +1179,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 bool bCurrFound  = false;
 bool bInInteger  = true;
 bool bExpSign = true;
+bool bDecAlign   = false;   // decimal alignment with "?"
 sal_Int32 nExpDigits = 0;
 sal_Int32 nIntegerSymbols = 0;  // for embedded-text, 
including "#"
 sal_Int32 nTrailingThousands = 0;   // thousands-separators after 
all digits
@@ -1207,9 +1208,17 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 }
 else if ( !bInInteger && pElemStr )
 {
-for ( sal_Int32 i = pElemStr->getLength()-1; i >= 0 && 
(*pElemStr)[i] == '#'; i-- )
+for ( sal_Int32 i = pElemStr->getLength()-1; i >= 0 ; 
i-- )
 {
-nMinDecimals --;
+sal_Unicode aChar = (*pElemStr)[i];
+if ( aChar == '#' || aChar == '?' )
+{
+nMinDecimals --;
+if ( aChar == '?' )
+bDecAlign = true;
+}
+else
+break;
 }
 }
 if ( bInInteger && pElemStr )
@@ -1429,6 +1438,9 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 OUStringBuffer sDashStr;
 if (bDecDashes && nPrecision > 0)
 
comphelper::string::padToLength(sDashStr, nPrecision, '-');
+// "?" in decimal part are replaced by 
space character
+if (bDecAlign && nPrecision > 0)
+sDashStr = " ";
 
 WriteNumberElement_Impl(nDecimals, 
nMinDecimals, nInteger, sDashStr.makeStringAndClear(),
 bThousand, nTrailingThousands, 
aEmbeddedEntries);
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index db1edc7..bb8f97f 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -102,6 +102,7 @@ struct SvXMLNumberInfo
 boolbGrouping;
 boolbDecReplace;
 boolbExpSign;
+boolbDecAlign;
 double  fDisplayFactor;
 std::map m_EmbeddedElements;
 
@@ -109,7 +110,7 @@ struct SvXMLNumberInfo
 {
 nDecimals = nInteger = nExpDigits = nExpInterval = nNumerDigits = 
nDenomDigits =
 nFracDenominator = nMinDecimalDigits = -1;
-bGrouping = bDecReplace = false;
+bGrouping = bDecReplace = bDecAlign = false;
 bExpSign = true;
 fDisplayFactor = 1.0;
 }
@@ -948,10 +949,16 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( 
SvXMLImport& rImport,
 aNumInfo.fDisplayFactor = fAttrDouble;
 break;
 case XML_TOK_ELEM_ATTR_DECIMAL_REPLACEMENT:
-if ( !sValue.isEmpty() )
-aNumInfo.bDecReplace = true;// only a default string 
is supported
+if ( sValue == " " )
+{
+aNumInfo.bDecAlign = true; // space replacement for "?"
+bVarDecimals = true;
+}
 else
-bVarDecimals = true;   // empty replacement string: 
variable decimals
+if ( sValue.isEmpty() )
+bVarDecimals = true;   // empty replacement string: 
variable decimals
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - xmloff/source

2016-01-19 Thread Caolán McNamara
 xmloff/source/text/XMLTextFrameContext.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ac05fade5b56be408b014140bd243b21e807be4a
Author: Caolán McNamara 
Date:   Tue Jan 19 14:03:12 2016 +

Resolves: tdf#96245 relax test for duplicate frame names

to allow duplicated unnamed frames

Change-Id: I871849b23d01209f027b6295777db705f7dc86d8
(cherry picked from commit 86963c2e23aebfa7b9df4e2d28278dfb581974d3)

diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index 2b4727e..20768ff 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -597,7 +597,8 @@ void XMLTextFrameContext_Impl::Create( bool 
/*bHRefOrBase64*/ )
 {
 bool bSuccess = xTextImportHelper->GetRenameMap().Add( 
XML_TEXT_RENAME_TYPE_FRAME,
  sOldName, sName );
-if (!bSuccess)
+
+if (!bSuccess && !sOldName.isEmpty())
 {
 bCreateFailed = true;
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - xmloff/source

2016-01-14 Thread Michael Stahl
 xmloff/source/core/xmlexp.cxx |   29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 15791e7c288e6ed134b06065771fbf9aed964467
Author: Michael Stahl 
Date:   Tue Jan 12 23:01:34 2016 +0100

xmloff: there is no reason why office:version should be omitted

... if a document contains foreign elements or attributes.

In fact since ODF 1.2 the office:version attribute is mandatory and any
document that omits it is therefore invalid, while "extended conforming"
documents are allowed to contain foreign elements and attributes.

This mysterious check was there since CVS initial import, but without
any justification.

Change-Id: Ifeafad2b7af41f06356461adb7ae65dbf7bae11d
(cherry picked from commit d277ac87455a599fbf4acd3c6401f09bc74d3dac)
Reviewed-on: https://gerrit.libreoffice.org/21425
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 737e7d1..f331e49 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1414,24 +1414,23 @@ sal_uInt32 SvXMLExport::exportDoc( enum 
::xmloff::token::XMLTokenEnum eClass )
 }
 
 // office:version = ...
-if( !mbExtended )
+const sal_Char* pVersion = nullptr;
+switch (getDefaultVersion())
 {
-const sal_Char* pVersion = nullptr;
-switch( getDefaultVersion() )
-{
-case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
-case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break;
-case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
-case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
-case SvtSaveOptions::ODFVER_010: break;
+case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
+case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break;
+case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
+case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
+case SvtSaveOptions::ODFVER_010: break;
 
-default:
-SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), 
unexpected odf default version!");
-}
+default:
+SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected 
odf default version!");
+}
 
-if( pVersion )
-AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION,
-  OUString::createFromAscii(pVersion) );
+if (pVersion)
+{
+AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION,
+  OUString::createFromAscii(pVersion) );
 }
 
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits