[Libreoffice-commits] core.git: 3 commits - dictionaries sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Dec 28 01:52:45 PST 2013
dictionaries | 2 +-
sc/source/core/tool/rangeutl.cxx | 2 +-
sc/source/filter/xml/xmlexprt.cxx | 8 ++++----
sc/source/filter/xml/xmlimprt.cxx | 3 +++
sc/source/filter/xml/xmlimprt.hxx | 5 ++++-
sc/source/filter/xml/xmltabi.cxx | 3 +++
6 files changed, 16 insertions(+), 7 deletions(-)
New commits:
commit 393a9d4151ae79c0ad5bf16fb161c0c7ced7ce53
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Dec 28 12:44:02 2013 +0100
don't write new elements/attribs to ODF namespaces
Related to validation errors with fdo#31296
Change-Id: I1b76e05a9996b1123db164629475a3f7b07dda69
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index a0bc807..0520e7c 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2886,12 +2886,12 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
if (pProtect && pProtect->isProtected() && getDefaultVersion() > SvtSaveOptions::ODFVER_012)
{
if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
- AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
+ AddAttribute(XML_NAMESPACE_OFFICE_EXT, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS))
- AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
+ AddAttribute(XML_NAMESPACE_OFFICE_EXT, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
OUString aElemName = GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION));
+ XML_NAMESPACE_OFFICE_EXT, GetXMLToken(XML_TABLE_PROTECTION));
SvXMLElementExport aElemProtected(*this, aElemName, true, true);
}
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 69f46b0..1f02083 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -829,6 +829,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap()
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLS },
{ XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COL },
{ XML_NAMESPACE_TABLE, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION },
+ { XML_NAMESPACE_OFFICE_EXT, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION_EXT },
{ XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROW_GROUP },
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS },
{ XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS },
@@ -857,6 +858,8 @@ const SvXMLTokenMap& ScXMLImport::GetTableProtectionAttrTokenMap()
{
{ XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS },
{ XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS },
+ { XML_NAMESPACE_OFFICE_EXT, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT },
+ { XML_NAMESPACE_OFFICE_EXT, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT },
XML_TOKEN_MAP_END
};
pTableProtectionElemTokenMap = new SvXMLTokenMap(aTableProtectionTokenMap);
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index f3dba75..bf2d9ae 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -247,6 +247,7 @@ enum ScXMLTableTokens
XML_TOK_TABLE_ROW_GROUP,
XML_TOK_TABLE_HEADER_ROWS,
XML_TOK_TABLE_PROTECTION,
+ XML_TOK_TABLE_PROTECTION_EXT,
XML_TOK_TABLE_ROWS,
XML_TOK_TABLE_ROW,
XML_TOK_TABLE_SOURCE,
@@ -261,7 +262,9 @@ enum ScXMLTableTokens
enum ScXMLTokenProtectionTokens
{
XML_TOK_TABLE_SELECT_PROTECTED_CELLS,
- XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS
+ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS,
+ XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT,
+ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT
};
enum ScXMLTableRowsTokens
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index 1701529..fc23c22 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -286,6 +286,7 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix,
rLName, xAttrList );
break;
case XML_TOK_TABLE_PROTECTION:
+ case XML_TOK_TABLE_PROTECTION_EXT:
pContext = new ScXMLTableProtectionContext( GetScImport(), nPrefix, rLName, xAttrList );
break;
case XML_TOK_TABLE_ROW_GROUP:
@@ -454,9 +455,11 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext(
switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName))
{
case XML_TOK_TABLE_SELECT_PROTECTED_CELLS:
+ case XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT:
bSelectProtectedCells = IsXMLToken(aValue, XML_TRUE);
break;
case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS:
+ case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT:
bSelectUnprotectedCells = IsXMLToken(aValue, XML_TRUE);
break;
default:
commit ff74eafbe6aae254e49abb4a0b93160825e4a9d7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Dec 28 08:13:12 2013 +0100
only write new element and attributes in ODF 1.2 extended
Change-Id: I038f200f500ef1c6a0815b6332fb17bb2f62282a
diff --git a/dictionaries b/dictionaries
index 569915c..f1a4eca 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 569915c40dc4b3df1f75abe9e1202e0d66f03281
+Subproject commit f1a4ecab4b10fe7e5daadd6529516d5ffeba0fda
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 8defd8a..a0bc807 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2883,7 +2883,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
SvXMLElementExport aElemT(*this, sElemTab, true, true);
- if (pProtect && pProtect->isProtected())
+ if (pProtect && pProtect->isProtected() && getDefaultVersion() > SvtSaveOptions::ODFVER_012)
{
if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
commit 4ecac870f1fd9172782b49c570c9e800f69da53f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Dec 19 04:36:55 2013 +0100
fix invalid string access in OUString::copy
Change-Id: Idccec35f2838b54a7915aa4a0aeb229c69bae74d
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 9e2ce6b..10fdf13 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -396,7 +396,7 @@ void ScRangeStringConverter::GetTokenByOffset(
sal_Unicode cQuote)
{
sal_Int32 nLength = rString.getLength();
- if( nOffset >= nLength )
+ if( nOffset == -1 || nOffset >= nLength )
{
rToken = OUString();
nOffset = -1;
More information about the Libreoffice-commits
mailing list