[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Nov 24 12:32:54 PST 2010
sc/source/filter/xml/xmlexprt.cxx | 77 ++++++++++++++++++--------------------
1 file changed, 38 insertions(+), 39 deletions(-)
New commits:
commit 953d38a11a4a715f6f8ce99db2e429d00ee914e4
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Nov 24 15:32:25 2010 -0500
Fixed indentation inconsistencies.
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index e160861..b69e987 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1749,46 +1749,45 @@ void ScXMLExport::_ExportContent()
AddAttribute(sAttrStyleName, aTableStyles[nTable]);
uno::Reference<util::XProtectable> xProtectable (xTable, uno::UNO_QUERY);
- ScTableProtection* pProtect = NULL;
+ ScTableProtection* pProtect = NULL;
if (xProtectable.is() && xProtectable->isProtected())
{
AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE);
if (pDoc)
{
- pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
+ pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
if (pProtect)
- {
- rtl::OUStringBuffer aBuffer;
- ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
- if (pProtect->hasPasswordHash(PASSHASH_SHA1))
- {
- SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_SHA1));
- eHashUsed = PASSHASH_SHA1;
- }
- else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1))
- {
- // Double-hash this by SHA1 on top of the legacy xls hash.
- uno::Sequence<sal_Int8> aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1);
- SvXMLUnitConverter::encodeBase64(aBuffer, aHash);
- eHashUsed = PASSHASH_XL;
- }
- if (aBuffer.getLength())
{
- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
- if (eHashUsed == PASSHASH_XL)
+ rtl::OUStringBuffer aBuffer;
+ ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
+ if (pProtect->hasPasswordHash(PASSHASH_SHA1))
{
- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
- ScPassHashHelper::getHashURI(PASSHASH_XL));
- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2,
- ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_SHA1));
+ eHashUsed = PASSHASH_SHA1;
+ }
+ else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1))
+ {
+ // Double-hash this by SHA1 on top of the legacy xls hash.
+ uno::Sequence<sal_Int8> aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1);
+ SvXMLUnitConverter::encodeBase64(aBuffer, aHash);
+ eHashUsed = PASSHASH_XL;
+ }
+ if (aBuffer.getLength())
+ {
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
+ if (eHashUsed == PASSHASH_XL)
+ {
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_XL));
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
+ }
+ else if (eHashUsed == PASSHASH_SHA1)
+ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
+ ScPassHashHelper::getHashURI(PASSHASH_SHA1));
}
- else if (eHashUsed == PASSHASH_SHA1)
- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM,
- ScPassHashHelper::getHashURI(PASSHASH_SHA1));
-
}
}
- }
}
rtl::OUString sPrintRanges;
table::CellRangeAddress aColumnHeaderRange;
@@ -1800,18 +1799,18 @@ void ScXMLExport::_ExportContent()
AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True);
- if (pProtect && pProtect->isProtected())
- {
- if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
- AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
- if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS))
- AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
+ if (pProtect && pProtect->isProtected())
+ {
+ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS))
+ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE);
+ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS))
+ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE);
- rtl::OUString aElemName = GetNamespaceMap().GetQNameByKey(
- XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION));
+ rtl::OUString aElemName = GetNamespaceMap().GetQNameByKey(
+ XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION));
- SvXMLElementExport aElemProtected(*this, aElemName, true, true);
- }
+ SvXMLElementExport aElemProtected(*this, aElemName, true, true);
+ }
CheckAttrList();
More information about the Libreoffice-commits
mailing list