summaryrefslogtreecommitdiff
path: root/xmloff/source/text/XMLTextMarkImportContext.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
commit92667c8edbaee9a252b1d5d221eb62849f76697c (patch)
tree8f1d329f2259b7d5bff054bc14d0965637df6961 /xmloff/source/text/XMLTextMarkImportContext.cxx
parentbaecdfb578cb7bc992944857ad4d8882ef7e842c (diff)
parent48b4a99ce2451f1ddf2e8e128bbfcd6683072999 (diff)
Merge branch 'master' into feature/gnumake4
Conflicts: connectivity/source/cpool/Zregistration.cxx connectivity/source/drivers/evoab/LCatalog.cxx connectivity/source/drivers/evoab/LColumnAlias.cxx connectivity/source/drivers/evoab/LColumnAlias.hxx connectivity/source/drivers/evoab/LColumns.cxx connectivity/source/drivers/evoab/LColumns.hxx connectivity/source/drivers/evoab/LConfigAccess.cxx connectivity/source/drivers/evoab/LConfigAccess.hxx connectivity/source/drivers/evoab/LConnection.cxx connectivity/source/drivers/evoab/LConnection.hxx connectivity/source/drivers/evoab/LDatabaseMetaData.cxx connectivity/source/drivers/evoab/LDatabaseMetaData.hxx connectivity/source/drivers/evoab/LDriver.cxx connectivity/source/drivers/evoab/LDriver.hxx connectivity/source/drivers/evoab/LFolderList.cxx connectivity/source/drivers/evoab/LFolderList.hxx connectivity/source/drivers/evoab/LNoException.cxx connectivity/source/drivers/evoab/LPreparedStatement.cxx connectivity/source/drivers/evoab/LPreparedStatement.hxx connectivity/source/drivers/evoab/LResultSet.cxx connectivity/source/drivers/evoab/LResultSet.hxx connectivity/source/drivers/evoab/LServices.cxx connectivity/source/drivers/evoab/LStatement.cxx connectivity/source/drivers/evoab/LStatement.hxx connectivity/source/drivers/evoab/LTable.cxx connectivity/source/drivers/evoab/LTable.hxx connectivity/source/drivers/evoab/LTables.cxx connectivity/source/drivers/evoab/LTables.hxx connectivity/source/drivers/evoab/evoab.xml connectivity/source/drivers/evoab/makefile.mk editeng/Library_editeng.mk framework/Library_fwe.mk framework/test/test.cxx idl/prj/d.lst idl/util/idlpch.cxx linguistic/Makefile linguistic/Module_linguistic.mk linguistic/inc/linguistic/lngdllapi.h linguistic/inc/linguistic/lngprophelp.hxx linguistic/inc/linguistic/misc.hxx linguistic/prj/build.lst linguistic/prj/d.lst linguistic/qa/unoapi/Test.java linguistic/source/grammarchecker.cxx linguistic/source/grammarchecker.hxx linguistic/source/hyphdta.cxx linguistic/source/lngprophelp.cxx linguistic/source/makefile.mk linguistic/source/spelldta.cxx sfx2/Library_qstart.mk sfx2/Library_sfx.mk sfx2/inc/sfx2/qswin32.h sfx2/prj/build.lst sfx2/qa/cppunit/makefile.mk xmlscript/inc/xmlscript/xcrdllapi.h xmlscript/prj/d.lst xmlscript/util/makefile.mk
Diffstat (limited to 'xmloff/source/text/XMLTextMarkImportContext.cxx')
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index e9db515955c1..ace0f99bc900 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,6 +65,8 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
+using rtl::OUString;
+
XMLFieldParamImportContext::XMLFieldParamImportContext(
SvXMLImport& rImport,
@@ -125,7 +128,7 @@ enum lcl_MarkType { TypeReference, TypeReferenceStart, TypeReferenceEnd,
TypeFieldmark, TypeFieldmarkStart, TypeFieldmarkEnd
};
-static SvXMLEnumMapEntry __READONLY_DATA lcl_aMarkTypeMap[] =
+static SvXMLEnumMapEntry const lcl_aMarkTypeMap[] =
{
{ XML_REFERENCE_MARK, TypeReference },
{ XML_REFERENCE_MARK_START, TypeReferenceStart },
@@ -144,11 +147,13 @@ static const char *lcl_getFormFieldmarkName(rtl::OUString &name)
{
static const char sCheckbox[]=ODF_FORMCHECKBOX;
static const char sFormDropDown[]=ODF_FORMDROPDOWN;
- if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0)
+ if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0 ||
+ name.compareToAscii("ecma.office-open-xml.field.FORMCHECKBOX")==0)
return sCheckbox;
else if (name.compareToAscii(ODF_FORMCHECKBOX)==0)
return sCheckbox;
- if (name.compareToAscii(ODF_FORMDROPDOWN)==0)
+ if (name.compareToAscii(ODF_FORMDROPDOWN)==0 ||
+ name.compareToAscii("ecma.office-open-xml.field.FORMDROPDOWN")==0)
return sFormDropDown;
else
return NULL;
@@ -157,7 +162,8 @@ static const char *lcl_getFormFieldmarkName(rtl::OUString &name)
static rtl::OUString lcl_getFieldmarkName(rtl::OUString &name)
{
static const char sFormtext[]=ODF_FORMTEXT;
- if (name.compareToAscii("msoffice.field.FORMTEXT")==0)
+ if (name.compareToAscii("msoffice.field.FORMTEXT")==0 ||
+ name.compareToAscii("ecma.office-open-xml.field.FORMTEXT")==0)
return rtl::OUString::createFromAscii(sFormtext);
else if (name.compareToAscii(ODF_FORMTEXT)==0)
return rtl::OUString::createFromAscii(sFormtext);
@@ -183,7 +189,7 @@ void XMLTextMarkImportContext::StartElement(
{
if (m_sBookmarkName.getLength() == 0)
{
- m_sBookmarkName = ::rtl::OUString::createFromAscii("Unknown");
+ m_sBookmarkName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown"));
}
m_rHelper.pushFieldCtx( m_sBookmarkName, m_sFieldName );
}
@@ -343,11 +349,11 @@ void XMLTextMarkImportContext::EndElement()
case TypeReferenceStart:
case TypeReferenceEnd:
- DBG_ERROR("reference start/end are handled in txtparai !");
+ OSL_FAIL("reference start/end are handled in txtparai !");
break;
default:
- DBG_ERROR("unknown mark type");
+ OSL_FAIL("unknown mark type");
break;
}
}
@@ -381,7 +387,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark(
if (!xIfc.is())
{
- OSL_ENSURE(false, "CreateAndInsertMark: cannot create service?");
+ OSL_FAIL("CreateAndInsertMark: cannot create service?");
return 0;
}
@@ -395,7 +401,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark(
{
if (sMarkName.getLength())
{
- OSL_ENSURE(false, "name given, but XNamed not supported?");
+ OSL_FAIL("name given, but XNamed not supported?");
return 0;
}
}
@@ -418,7 +424,7 @@ Reference<XTextContent> XMLTextMarkImportContext::CreateAndInsertMark(
}
catch (com::sun::star::lang::IllegalArgumentException &)
{
- OSL_ENSURE(false, "CreateAndInsertMark: cannot insert?");
+ OSL_FAIL("CreateAndInsertMark: cannot insert?");
return 0;
}
}
@@ -483,3 +489,4 @@ sal_Bool XMLTextMarkImportContext::FindName(
return bNameOK;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */