targeted string re-work

Change-Id: I6a417dbea4a0b00be3f8e4b6dbe1ef0f4bbcbeed
This commit is contained in:
Norbert Thiebaud 2012-06-02 19:43:57 -05:00
parent be8c8f1789
commit c4d18d0259
3 changed files with 212 additions and 212 deletions

View File

@ -40,7 +40,7 @@
// deklarations
//------------------------------------------------------------------------
const rtl::OUString TEXTPLAIN_PARAM_CHARSET = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("charset"));
const rtl::OUString TEXTPLAIN_PARAM_CHARSET("charset");
const rtl::OUString PRE_WINDOWS_CODEPAGE ("windows");
const rtl::OUString PRE_OEM_CODEPAGE ("cp");

View File

@ -655,30 +655,30 @@ SfxDocumentMetaData::getURLProperties(
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference< css::beans::XPropertyContainer> xPropArg(
xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.beans.PropertyBag")), m_xContext),
xMsf->createInstanceWithContext(::rtl::OUString(
"com.sun.star.beans.PropertyBag"), m_xContext),
css::uno::UNO_QUERY_THROW);
try {
::rtl::OUString dburl =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL"));
::rtl::OUString("DocumentBaseURL");
::rtl::OUString hdn =
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName"));
::rtl::OUString("HierarchicalDocumentName");
for (sal_Int32 i = 0; i < i_rMedium.getLength(); ++i) {
if (i_rMedium[i].Name.equals(dburl)) {
xPropArg->addProperty(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")),
::rtl::OUString("BaseURI"),
css::beans::PropertyAttribute::MAYBEVOID,
i_rMedium[i].Value);
} else if (i_rMedium[i].Name.equals(hdn)) {
xPropArg->addProperty(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")),
::rtl::OUString("StreamRelPath"),
css::beans::PropertyAttribute::MAYBEVOID,
i_rMedium[i].Value);
}
}
xPropArg->addProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")),
xPropArg->addProperty(::rtl::OUString("StreamName"),
css::beans::PropertyAttribute::MAYBEVOID,
css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta))));
css::uno::makeAny(::rtl::OUString(s_meta)));
} catch (const css::uno::Exception &) {
// ignore
}
@ -693,8 +693,8 @@ getNodeText(css::uno::Reference<css::xml::dom::XNode> i_xNode)
throw (css::uno::RuntimeException)
{
if (!i_xNode.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::getNodeText: argument is null")), i_xNode);
::rtl::OUString(
"SfxDocumentMetaData::getNodeText: argument is null"), i_xNode);
for (css::uno::Reference<css::xml::dom::XNode> c = i_xNode->getFirstChild();
c.is();
c = c->getNextSibling()) {
@ -773,8 +773,8 @@ SfxDocumentMetaData::setMetaText(const char* i_name,
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::setMetaText: DOM exception")),
::rtl::OUString(
"SfxDocumentMetaData::setMetaText: DOM exception"),
css::uno::Reference<css::uno::XInterface>(*this), a);
}
}
@ -910,8 +910,8 @@ SfxDocumentMetaData::setMetaList(const char* i_name,
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::setMetaList: DOM exception")),
::rtl::OUString(
"SfxDocumentMetaData::setMetaList: DOM exception"),
css::uno::Reference<css::uno::XInterface>(*this), a);
}
}
@ -952,7 +952,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
::sax::Converter::convertBool(buf, b);
values.push_back(buf.makeStringAndClear());
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean"))));
::rtl::OUString("boolean")));
} else if (type == ::cppu::UnoType< ::rtl::OUString>::get()) {
::rtl::OUString s;
any >>= s;
@ -964,20 +964,20 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
if (4 <= i)
{
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string"))));
::rtl::OUString("string")));
}
} else if (type == ::cppu::UnoType<css::util::DateTime>::get()) {
css::util::DateTime dt;
any >>= dt;
values.push_back(dateTimeToText(dt));
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date"))));
::rtl::OUString("date")));
} else if (type == ::cppu::UnoType<css::util::Date>::get()) {
css::util::Date d;
any >>= d;
values.push_back(dateToText(d));
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("date"))));
::rtl::OUString("date")));
} else if (type == ::cppu::UnoType<css::util::Time>::get()) {
// #i97029#: replaced by Duration
// Time is supported for backward compatibility with OOo 3.x, x<=2
@ -990,13 +990,13 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
ud.MilliSeconds = 10 * ut.HundredthSeconds;
values.push_back(durationToText(ud));
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time"))));
::rtl::OUString("time")));
} else if (type == ::cppu::UnoType<css::util::Duration>::get()) {
css::util::Duration ud;
any >>= ud;
values.push_back(durationToText(ud));
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time"))));
::rtl::OUString("time")));
} else if (::cppu::UnoType<double>::get().isAssignableFrom(type)) {
// support not just double, but anything that can be converted
double d = 0;
@ -1005,7 +1005,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
::sax::Converter::convertDouble(buf, d);
values.push_back(buf.makeStringAndClear());
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float"))));
::rtl::OUString("float")));
} else {
DBG_WARNING1("SfxDocumentMetaData: unsupported property type: %s",
OUStringToOString(any.getValueTypeName(),
@ -1051,8 +1051,8 @@ SfxDocumentMetaData::updateElement(const char *i_name,
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::updateElement: DOM exception")),
::rtl::OUString(
"SfxDocumentMetaData::updateElement: DOM exception"),
css::uno::Reference<css::uno::XInterface>(*this), a);
}
}
@ -1074,10 +1074,10 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
|| isValidDateTime(m_TemplateDate)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:type"),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simple"))));
::rtl::OUString("simple")));
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:actuate"),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("onRequest"))));
::rtl::OUString("onRequest")));
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:title"), m_TemplateName));
attributes.push_back(std::make_pair(
@ -1128,18 +1128,18 @@ SfxDocumentMetaData::createDOM() const // throw (css::uno::RuntimeException)
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference<css::xml::dom::XDocumentBuilder> xBuilder(
xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.dom.DocumentBuilder")), m_xContext),
xMsf->createInstanceWithContext(::rtl::OUString(
"com.sun.star.xml.dom.DocumentBuilder"), m_xContext),
css::uno::UNO_QUERY_THROW );
if (!xBuilder.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: "
"cannot create DocumentBuilder service")),
::rtl::OUString("SfxDocumentMetaData::createDOM: "
"cannot create DocumentBuilder service"),
*const_cast<SfxDocumentMetaData*>(this));
css::uno::Reference<css::xml::dom::XDocument> xDoc =
xBuilder->newDocument();
if (!xDoc.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::createDOM: "
"cannot create new document")),
::rtl::OUString("SfxDocumentMetaData::createDOM: "
"cannot create new document"),
*const_cast<SfxDocumentMetaData*>(this));
return xDoc;
}
@ -1148,8 +1148,8 @@ void SAL_CALL
SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException)
{
if (!m_isInitialized) {
throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::checkInit: not initialized")),
throw css::uno::RuntimeException(::rtl::OUString(
"SfxDocumentMetaData::checkInit: not initialized"),
*const_cast<SfxDocumentMetaData*>(this));
}
DBG_ASSERT((m_xDoc.is() && m_xParent.is() ),
@ -1161,36 +1161,36 @@ void SAL_CALL SfxDocumentMetaData::init(
css::uno::Reference<css::xml::dom::XDocument> i_xDoc)
{
if (!i_xDoc.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::init: no DOM tree given")), *this);
::rtl::OUString(
"SfxDocumentMetaData::init: no DOM tree given"), *this);
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference<css::xml::xpath::XXPathAPI> xPath(
xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.xpath.XPathAPI")), m_xContext),
xMsf->createInstanceWithContext(::rtl::OUString(
"com.sun.star.xml.xpath.XPathAPI"), m_xContext),
css::uno::UNO_QUERY_THROW );
if (!xPath.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::init:"
" cannot create XPathAPI service")), *this);
::rtl::OUString("SfxDocumentMetaData::init:"
" cannot create XPathAPI service"), *this);
m_isInitialized = false;
m_xDoc = i_xDoc;
// select nodes for standard meta data stuff
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
xPath->registerNS(::rtl::OUString("xlink"),
::rtl::OUString::createFromAscii(s_nsXLink));
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc")),
xPath->registerNS(::rtl::OUString("dc"),
::rtl::OUString::createFromAscii(s_nsDC));
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office")),
xPath->registerNS(::rtl::OUString("office"),
::rtl::OUString::createFromAscii(s_nsODF));
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta")),
xPath->registerNS(::rtl::OUString("meta"),
::rtl::OUString::createFromAscii(s_nsODFMeta));
// NB: we do not handle the single-XML-file ODF variant, which would
// have the root element office:document.
// The root of such documents must be converted in the importer!
::rtl::OUString prefix(RTL_CONSTASCII_USTRINGPARAM(
"/child::office:document-meta/child::office:meta"));
::rtl::OUString prefix(
"/child::office:document-meta/child::office:meta");
css::uno::Reference<css::xml::dom::XNode> xDocNode(
m_xDoc, css::uno::UNO_QUERY_THROW);
m_xParent.clear();
@ -1229,27 +1229,27 @@ void SAL_CALL SfxDocumentMetaData::init(
if (!xRElem.is()) {
xRElem = i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:document-meta")));
::rtl::OUString("office:document-meta"));
css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
css::uno::UNO_QUERY_THROW);
i_xDoc->appendChild(xRNode);
}
xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:version")),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1.0")));
::rtl::OUString("office:version"),
::rtl::OUString("1.0"));
// does not exist, otherwise m_xParent would not be null
css::uno::Reference<css::xml::dom::XNode> xParent (
i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:meta"))),
::rtl::OUString("office:meta")),
css::uno::UNO_QUERY_THROW);
xRElem->appendChild(xParent);
m_xParent = xParent;
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::init: DOM exception")),
::rtl::OUString(
"SfxDocumentMetaData::init: DOM exception"),
css::uno::Reference<css::uno::XInterface>(*this), a);
}
}
@ -1266,7 +1266,7 @@ void SAL_CALL SfxDocumentMetaData::init(
// application-specific.
css::uno::Reference<css::xml::dom::XNode> xNode =
xPath->selectSingleNode(m_xParent,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name);
::rtl::OUString("child::") + name);
// Do not create an empty element if it is missing;
// for certain elements, such as dateTime, this would be invalid
m_meta[name] = xNode;
@ -1277,7 +1277,7 @@ void SAL_CALL SfxDocumentMetaData::init(
::rtl::OUString name = ::rtl::OUString::createFromAscii(*pName);
css::uno::Reference<css::xml::dom::XNodeList> nodes =
xPath->selectNodeList(m_xParent,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("child::")) + name);
::rtl::OUString("child::") + name);
std::vector<css::uno::Reference<css::xml::dom::XNode> > v;
for (sal_Int32 i = 0; i < nodes->getLength(); ++i) {
v.push_back(nodes->item(i));
@ -1298,7 +1298,7 @@ void SAL_CALL SfxDocumentMetaData::init(
std::vector<css::uno::Reference<css::xml::dom::XNode> > & vec =
m_metaList[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta:user-defined"))];
m_metaList[::rtl::OUString("meta:user-defined")];
m_xUserDefined.clear(); // #i105826#: reset (may be re-initialization)
if ( !vec.empty() )
{
@ -1313,10 +1313,10 @@ void SAL_CALL SfxDocumentMetaData::init(
css::uno::Any any;
::rtl::OUString name = xElem->getAttributeNS(
::rtl::OUString::createFromAscii(s_nsODFMeta),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")));
::rtl::OUString("name"));
::rtl::OUString type = xElem->getAttributeNS(
::rtl::OUString::createFromAscii(s_nsODFMeta),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value-type")));
::rtl::OUString("value-type"));
::rtl::OUString text = getNodeText(*it);
if ( type == "float" ) {
double d;
@ -1573,7 +1573,7 @@ SfxDocumentMetaData::setLanguage(const css::lang::Locale & the_value)
{
::rtl::OUString text = the_value.Language;
if (!the_value.Country.isEmpty()) {
text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")).concat(the_value.Country);
text += ::rtl::OUString("-").concat(the_value.Country);
}
setMetaTextAndNotify("dc:language", text);
}
@ -1731,8 +1731,8 @@ SfxDocumentMetaData::setAutoloadSecs(::sal_Int32 the_value)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
if (the_value < 0) throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::setAutoloadSecs: argument is negative")),
::rtl::OUString(
"SfxDocumentMetaData::setAutoloadSecs: argument is negative"),
*this, 0);
::osl::ClearableMutexGuard g(m_aMutex);
checkInit();
@ -1845,8 +1845,8 @@ SfxDocumentMetaData::setEditingCycles(::sal_Int16 the_value)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
if (the_value < 0) throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::setEditingCycles: argument is negative")),
::rtl::OUString(
"SfxDocumentMetaData::setEditingCycles: argument is negative"),
*this, 0);
::rtl::OUStringBuffer buf;
::sax::Converter::convertNumber(buf, the_value);
@ -1865,8 +1865,8 @@ SfxDocumentMetaData::setEditingDuration(::sal_Int32 the_value)
throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
if (the_value < 0) throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::setEditingDuration: argument is negative")),
::rtl::OUString(
"SfxDocumentMetaData::setEditingDuration: argument is negative"),
*this, 0);
setMetaTextAndNotify("meta:editing-duration", durationToText(the_value));
}
@ -1890,7 +1890,7 @@ SfxDocumentMetaData::resetUserData(const ::rtl::OUString & the_value)
dateTimeToText(css::util::DateTime()));
bModified |= setMetaText("meta:editing-duration", durationToText(0));
bModified |= setMetaText("meta:editing-cycles",
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
::rtl::OUString("1"));
if (bModified) {
g.clear();
@ -1919,14 +1919,14 @@ SfxDocumentMetaData::loadFromStorage(
css::lang::WrappedTargetException, css::io::IOException)
{
if (!xStorage.is()) throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:"
" argument is null")), *this, 0);
::rtl::OUString("SfxDocumentMetaData::loadFromStorage:"
" argument is null"), *this, 0);
::osl::MutexGuard g(m_aMutex);
// open meta data file
css::uno::Reference<css::io::XStream> xStream(
xStorage->openStreamElement(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)),
::rtl::OUString(s_meta),
css::embed::ElementModes::READ) );
if (!xStream.is()) throw css::uno::RuntimeException();
css::uno::Reference<css::io::XInputStream> xInStream =
@ -1937,12 +1937,12 @@ SfxDocumentMetaData::loadFromStorage(
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference<css::xml::sax::XParser> xParser (
xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.sax.Parser")), m_xContext),
xMsf->createInstanceWithContext(::rtl::OUString(
"com.sun.star.xml.sax.Parser"), m_xContext),
css::uno::UNO_QUERY_THROW);
if (!xParser.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:"
" cannot create Parser service")), *this);
::rtl::OUString("SfxDocumentMetaData::loadFromStorage:"
" cannot create Parser service"), *this);
css::xml::sax::InputSource input;
input.aInputStream = xInStream;
@ -1957,12 +1957,12 @@ SfxDocumentMetaData::loadFromStorage(
css::uno::Reference<css::beans::XPropertySet> xPropArg =
getURLProperties(Medium);
try {
xPropArg->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")))
xPropArg->getPropertyValue(::rtl::OUString("BaseURI"))
>>= input.sSystemId;
input.sSystemId += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")).concat(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)));
input.sSystemId += ::rtl::OUString("/").concat(
::rtl::OUString(s_meta));
} catch (const css::uno::Exception &) {
input.sSystemId = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta));
input.sSystemId = ::rtl::OUString(s_meta);
}
css::uno::Sequence< css::uno::Any > args(1);
args[0] <<= xPropArg;
@ -1972,8 +1972,8 @@ SfxDocumentMetaData::loadFromStorage(
::rtl::OUString::createFromAscii(pServiceName), args, m_xContext),
css::uno::UNO_QUERY_THROW);
if (!xDocHandler.is()) throw css::uno::RuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::loadFromStorage:"
" cannot create XMLOasisMetaImporter service")), *this);
::rtl::OUString("SfxDocumentMetaData::loadFromStorage:"
" cannot create XMLOasisMetaImporter service"), *this);
css::uno::Reference<css::document::XImporter> xImp (xDocHandler,
css::uno::UNO_QUERY_THROW);
xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this));
@ -1981,9 +1981,9 @@ SfxDocumentMetaData::loadFromStorage(
try {
xParser->parseStream(input);
} catch (const css::xml::sax::SAXException &) {
throw css::io::WrongFormatException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
throw css::io::WrongFormatException(::rtl::OUString(
"SfxDocumentMetaData::loadFromStorage:"
" XML parsing exception")), *this);
" XML parsing exception"), *this);
}
// NB: the implementation of XMLOasisMetaImporter calls initialize
checkInit();
@ -1997,8 +1997,8 @@ SfxDocumentMetaData::storeToStorage(
css::lang::WrappedTargetException, css::io::IOException)
{
if (!xStorage.is()) throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::storeToStorage:"
" argument is null")), *this, 0);
::rtl::OUString("SfxDocumentMetaData::storeToStorage:"
" argument is null"), *this, 0);
::osl::MutexGuard g(m_aMutex);
checkInit();
@ -2007,20 +2007,20 @@ SfxDocumentMetaData::storeToStorage(
// write into storage
css::uno::Reference<css::io::XStream> xStream =
xStorage->openStreamElement(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)),
xStorage->openStreamElement(::rtl::OUString(s_meta),
css::embed::ElementModes::WRITE
| css::embed::ElementModes::TRUNCATE);
if (!xStream.is()) throw css::uno::RuntimeException();
css::uno::Reference< css::beans::XPropertySet > xStreamProps(xStream,
css::uno::UNO_QUERY_THROW);
xStreamProps->setPropertyValue(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),
css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/xml"))));
::rtl::OUString("MediaType"),
css::uno::makeAny(::rtl::OUString("text/xml")));
xStreamProps->setPropertyValue(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")),
::rtl::OUString("Compressed"),
css::uno::makeAny(static_cast<sal_Bool> (sal_False)));
xStreamProps->setPropertyValue(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption")),
::rtl::OUString("UseCommonStoragePasswordEncryption"),
css::uno::makeAny(static_cast<sal_Bool> (sal_False)));
css::uno::Reference<css::io::XOutputStream> xOutStream =
xStream->getOutputStream();
@ -2028,8 +2028,8 @@ SfxDocumentMetaData::storeToStorage(
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
css::uno::Reference<css::io::XActiveDataSource> xSaxWriter(
xMsf->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.sax.Writer")), m_xContext),
xMsf->createInstanceWithContext(::rtl::OUString(
"com.sun.star.xml.sax.Writer"), m_xContext),
css::uno::UNO_QUERY_THROW);
xSaxWriter->setOutputStream(xOutStream);
css::uno::Reference<css::xml::sax::XDocumentHandler> xDocHandler (
@ -2063,8 +2063,8 @@ SfxDocumentMetaData::storeToStorage(
xTransaction->commit();
}
} else {
throw css::io::IOException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::storeToStorage: cannot filter")), *this);
throw css::io::IOException(::rtl::OUString(
"SfxDocumentMetaData::storeToStorage: cannot filter"), *this);
}
}
@ -2100,14 +2100,14 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL,
throw;
} catch (const css::uno::Exception & e) {
throw css::lang::WrappedTargetException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::loadFromMedium: exception")),
::rtl::OUString(
"SfxDocumentMetaData::loadFromMedium: exception"),
css::uno::Reference<css::uno::XInterface>(*this),
css::uno::makeAny(e));
}
if (!xStorage.is()) {
throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::loadFromMedium: cannot get Storage")),
throw css::uno::RuntimeException(::rtl::OUString(
"SfxDocumentMetaData::loadFromMedium: cannot get Storage"),
*this);
}
loadFromStorage(xStorage, md.getAsConstPropertyValueList());
@ -2129,8 +2129,8 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL,
if (!xStorage.is()) {
throw css::uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::storeToMedium: cannot get Storage")),
throw css::uno::RuntimeException(::rtl::OUString(
"SfxDocumentMetaData::storeToMedium: cannot get Storage"),
*this);
}
// set MIME type of the storage
@ -2179,14 +2179,14 @@ SfxDocumentMetaData::initialize(
if (any >>= xDoc) {
if (!xDoc.is()) {
throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::"
"initialize: argument is null")),
::rtl::OUString("SfxDocumentMetaData::"
"initialize: argument is null"),
*this, static_cast<sal_Int16>(i));
}
} else {
throw css::lang::IllegalArgumentException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SfxDocumentMetaData::"
"initialize: argument must be XDocument")),
::rtl::OUString("SfxDocumentMetaData::"
"initialize: argument must be XDocument"),
*this, static_cast<sal_Int16>(i));
}
}
@ -2225,8 +2225,8 @@ SfxDocumentMetaData::createClone()
} catch (const css::uno::Exception & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::createClone: exception")),
::rtl::OUString(
"SfxDocumentMetaData::createClone: exception"),
css::uno::Reference<css::uno::XInterface>(*this), a);
}
return css::uno::Reference<css::util::XCloneable> (pNew);
@ -2343,19 +2343,19 @@ void SfxDocumentMetaData::createUserDefined()
types[10] = ::cppu::UnoType<css::util::Time>::get();
css::uno::Sequence<css::uno::Any> args(2);
args[0] <<= css::beans::NamedValue(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowedTypes")),
::rtl::OUString("AllowedTypes"),
css::uno::makeAny(types));
// #i94175#: ODF allows empty user-defined property names!
args[1] <<= css::beans::NamedValue( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("AllowEmptyPropertyName")),
"AllowEmptyPropertyName"),
css::uno::makeAny(sal_True));
const css::uno::Reference<css::lang::XMultiComponentFactory> xMsf(
m_xContext->getServiceManager());
m_xUserDefined.set(
xMsf->createInstanceWithContext(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.beans.PropertyBag")), m_xContext),
::rtl::OUString(
"com.sun.star.beans.PropertyBag"), m_xContext),
css::uno::UNO_QUERY_THROW);
const css::uno::Reference<css::lang::XInitialization> xInit(
m_xUserDefined, css::uno::UNO_QUERY);
@ -2387,14 +2387,14 @@ void SfxDocumentMetaData::createUserDefined()
namespace comp_CompatWriterDocProps {
::rtl::OUString SAL_CALL _getImplementationName() {
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"CompatWriterDocPropsImpl"));
return ::rtl::OUString(
"CompatWriterDocPropsImpl");
}
css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
{
css::uno::Sequence< rtl::OUString > aServiceNames(1);
aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.writer.DocumentProperties" ) );
aServiceNames[ 0 ] = rtl::OUString( "com.sun.star.writer.DocumentProperties" );
return aServiceNames;
}
css::uno::Reference< css::uno::XInterface > SAL_CALL _create(
@ -2409,15 +2409,15 @@ namespace comp_CompatWriterDocProps {
namespace comp_SfxDocumentMetaData {
::rtl::OUString SAL_CALL _getImplementationName() {
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData"));
return ::rtl::OUString(
"SfxDocumentMetaData");
}
css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
{
css::uno::Sequence< ::rtl::OUString > s(1);
s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.document.DocumentProperties"));
s[0] = ::rtl::OUString(
"com.sun.star.document.DocumentProperties");
return s;
}

View File

@ -292,8 +292,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
const uno::Reference<frame::
XTransientDocumentsDocumentContentFactory> xTDDCF(
xMsf->createInstanceWithContext(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame."
"TransientDocumentsDocumentContentFactory")),
::rtl::OUString("com.sun.star.frame."
"TransientDocumentsDocumentContentFactory"),
xContext),
uno::UNO_QUERY_THROW);
const uno::Reference<ucb::XContent> xContent(
@ -307,7 +307,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?");
if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1))
{
uri = uri + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
uri = uri + ::rtl::OUString("/");
}
m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess(
@ -481,8 +481,8 @@ SfxSaveGuard::SfxSaveGuard(const uno::Reference< frame::XModel >& xM
, m_pData (pData )
, m_pFramesLock(0 )
{
static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Object already disposed."));
static ::rtl::OUString MSG_2(RTL_CONSTASCII_USTRINGPARAM("Concurrent save requests on the same document are not possible."));
static ::rtl::OUString MSG_1("Object already disposed.");
static ::rtl::OUString MSG_2("Concurrent save requests on the same document are not possible.");
if ( m_pData->m_bClosed )
throw ::com::sun::star::lang::DisposedException(
@ -907,12 +907,12 @@ uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo
} catch (uno::RuntimeException &) {
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxBaseModel::getDocumentInfo: cannot initialize")), *this,
throw lang::WrappedTargetRuntimeException(::rtl::OUString(
"SfxBaseModel::getDocumentInfo: cannot initialize"), *this,
uno::makeAny(e));
}
try {
rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
rtl::OUString aName("MediaType");
uno::Reference < beans::XPropertySet > xSet(
getDocumentStorage(), uno::UNO_QUERY_THROW );
uno::Any aMediaType = xSet->getPropertyValue( aName );
@ -1114,13 +1114,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c
aRectSeq[3] = aTmpRect.Bottom();
seqArgsNew.realloc( ++nNewLength );
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WinExtent"));
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("WinExtent");
seqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq;
if ( !m_pData->m_aPreusedFilterName.isEmpty() )
{
seqArgsNew.realloc( ++nNewLength );
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreusedFilterName"));
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("PreusedFilterName");
seqArgsNew[ nNewLength - 1 ].Value <<= m_pData->m_aPreusedFilterName;
}
@ -1136,7 +1136,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c
aBorderSeq[3] = aBorder.Bottom();
seqArgsNew.realloc( ++nNewLength );
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentBorder"));
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString("DocumentBorder");
seqArgsNew[ nNewLength - 1 ].Value <<= aBorderSeq;
}
@ -1473,7 +1473,7 @@ void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLI
void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException)
{
static ::rtl::OUString MSG_1(RTL_CONSTASCII_USTRINGPARAM("Cant close while saving."));
static ::rtl::OUString MSG_1("Cant close while saving.");
SolarMutexGuard aGuard;
if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing )
@ -1643,7 +1643,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
if ( m_pData->m_pObjectShell.Is() )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeSelf" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeSelf" ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
for ( sal_Int32 nInd = 0; nInd < aSeqArgs.getLength(); nInd++ )
@ -1652,10 +1652,10 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
if ( aSeqArgs[nInd].Name != "VersionComment" && aSeqArgs[nInd].Name != "Author"
&& aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) );
m_pData->m_pObjectShell->StoreLog();
::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Unexpected MediaDescriptor parameter: " ) );
::rtl::OUString aMessage( "Unexpected MediaDescriptor parameter: " );
aMessage += aSeqArgs[nInd].Name;
throw lang::IllegalArgumentException( aMessage, uno::Reference< uno::XInterface >(), 1 );
}
@ -1697,14 +1697,14 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
if ( bRet )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "successful saving." ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "successful saving." ) );
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCDONE), m_pData->m_pObjectShell ) );
}
else
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing failed!" ) );
m_pData->m_pObjectShell->StoreLog();
// write the contents of the logger to the file
@ -1739,7 +1739,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
if ( m_pData->m_pObjectShell.Is() )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeAsURL" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeAsURL" ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
impl_store( rURL, rArgs, sal_False );
@ -1778,7 +1778,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString&
if ( m_pData->m_pObjectShell.Is() )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeToURL" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "storeToURL" ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
impl_store( rURL, rArgs, sal_True );
}
@ -2269,55 +2269,55 @@ uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors()
uno::Sequence< DATAFLAVOR > aFlavorSeq( nSuppFlavors );
aFlavorSeq[0].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) );
aFlavorSeq[0].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" ) );
::rtl::OUString( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
aFlavorSeq[0].HumanPresentableName = ::rtl::OUString( "GDIMetaFile" );
aFlavorSeq[0].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[1].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) );
aFlavorSeq[1].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" ) );
::rtl::OUString( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
aFlavorSeq[1].HumanPresentableName = ::rtl::OUString( "GDIMetaFile" );
aFlavorSeq[1].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[2].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) );
aFlavorSeq[2].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enhanced Windows MetaFile" ) );
::rtl::OUString( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" );
aFlavorSeq[2].HumanPresentableName = ::rtl::OUString( "Enhanced Windows MetaFile" );
aFlavorSeq[2].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[3].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) );
aFlavorSeq[3].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Windows MetaFile" ) );
::rtl::OUString( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" );
aFlavorSeq[3].HumanPresentableName = ::rtl::OUString( "Windows MetaFile" );
aFlavorSeq[3].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[4].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) );
aFlavorSeq[4].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Star Object Descriptor (XML)" ) );
::rtl::OUString( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" );
aFlavorSeq[4].HumanPresentableName = ::rtl::OUString( "Star Object Descriptor (XML)" );
aFlavorSeq[4].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[5].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"" ) );
aFlavorSeq[5].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Star Embed Source (XML)" ) );
::rtl::OUString( "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"" );
aFlavorSeq[5].HumanPresentableName = ::rtl::OUString( "Star Embed Source (XML)" );
aFlavorSeq[5].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[6].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) );
aFlavorSeq[6].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) );
::rtl::OUString( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" );
aFlavorSeq[6].HumanPresentableName = ::rtl::OUString( "Bitmap" );
aFlavorSeq[6].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
aFlavorSeq[7].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "image/png" ) );
aFlavorSeq[7].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PNG" ) );
::rtl::OUString( "image/png" );
aFlavorSeq[7].HumanPresentableName = ::rtl::OUString( "PNG" );
aFlavorSeq[7].DataType = getCppuType( (const Sequence< sal_Int8 >*) 0 );
if ( nSuppFlavors == 10 )
{
aFlavorSeq[8].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) );
aFlavorSeq[8].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enhanced Windows MetaFile" ) );
::rtl::OUString( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" );
aFlavorSeq[8].HumanPresentableName = ::rtl::OUString( "Enhanced Windows MetaFile" );
aFlavorSeq[8].DataType = getCppuType( (const sal_uInt64*) 0 );
aFlavorSeq[9].MimeType =
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) );
aFlavorSeq[9].HumanPresentableName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Windows MetaFile" ) );
::rtl::OUString( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" );
aFlavorSeq[9].HumanPresentableName = ::rtl::OUString( "Windows MetaFile" );
aFlavorSeq[9].DataType = getCppuType( (const sal_uInt64*) 0 );
}
@ -2515,7 +2515,7 @@ void SAL_CALL SfxBaseModel::removeDocumentEventListener( const uno::Reference< d
void SAL_CALL SfxBaseModel::notifyDocumentEvent( const ::rtl::OUString&, const uno::Reference< frame::XController2 >&, const uno::Any& )
throw ( lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException )
{
throw lang::NoSupportException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SfxBaseModel controlls all the sent notifications itself!" ) ), uno::Reference< uno::XInterface >() );
throw lang::NoSupportException( ::rtl::OUString( "SfxBaseModel controlls all the sent notifications itself!" ), uno::Reference< uno::XInterface >() );
}
//________________________________________________________________________________________________________
@ -2540,7 +2540,7 @@ void addTitle_Impl( Sequence < ::com::sun::star::beans::PropertyValue >& rSeq, c
if ( nArg == nCount )
{
rSeq.realloc( nCount+1 );
rSeq[nCount].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") );
rSeq[nCount].Name = ::rtl::OUString( "Title" );
rSeq[nCount].Value <<= rTitle;
}
}
@ -2569,7 +2569,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
&& m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
uno::Reference< XSTORAGE > xConfigStorage;
rtl::OUString aUIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" ));
rtl::OUString aUIConfigFolderName( "Configurations2" );
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, com::sun::star::embed::ElementModes::READWRITE );
if ( !xConfigStorage.is() )
@ -2745,7 +2745,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
// this is the same file URL as the current document location, try to use storeOwn if possible
::comphelper::SequenceAsHashMap aArgHash( seqArguments );
::rtl::OUString aFilterString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
::rtl::OUString aFilterString( "FilterName" );
::rtl::OUString aFilterName = aArgHash.getUnpackedValueOrDefault( aFilterString, ::rtl::OUString() );
if ( !aFilterName.isEmpty() )
{
@ -2756,7 +2756,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( pFilter && aFilterName.equals( pFilter->GetFilterName() ) )
{
aArgHash.erase( aFilterString );
aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
aArgHash.erase( ::rtl::OUString( "URL" ) );
try
{
@ -2771,13 +2771,13 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
// TODO/LATER: need a new interaction for this case
if ( m_pData->m_pObjectShell->IsDocShared() )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Can't store shared document!" ) );
m_pData->m_pObjectShell->StoreLog();
uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) ), uno::Sequence< beans::NamedValue >() );
uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( "EncryptionData" ), uno::Sequence< beans::NamedValue >() );
if ( !aNewEncryptionData.getLength() )
{
::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ), ::rtl::OUString() );
::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( "Password" ), ::rtl::OUString() );
aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aNewPassword );
}
@ -2789,7 +2789,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
else
{
// if the password is changed a special error should be used in case of shared document
throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
throw task::ErrorCodeIOException( ::rtl::OUString( "Cant change password for shared document." ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
}
}
}
@ -2814,11 +2814,11 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
if ( pCopyStreamItem && pCopyStreamItem->GetValue() && !bSaveTo )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" ) );
m_pData->m_pObjectShell->StoreLog();
throw frame::IllegalArgumentIOException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!") ),
::rtl::OUString( "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!"),
uno::Reference< uno::XInterface >() );
}
@ -2893,7 +2893,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetErrorCode();
if ( !bRet && !nErrCode )
{
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing has failed, no error is set!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing has failed, no error is set!" ) );
nErrCode = ERRCODE_IO_CANTWRITE;
}
m_pData->m_pObjectShell->ResetError();
@ -2914,7 +2914,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
}
}
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing succeeded!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing succeeded!" ) );
if ( !bSaveTo )
{
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
@ -2933,7 +2933,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
else
{
// let the logring be stored to the related file
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
m_pData->m_pObjectShell->AddLog( ::rtl::OUString( OSL_LOG_PREFIX "Storing failed!" ) );
m_pData->m_pObjectShell->StoreLog();
m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
@ -3301,8 +3301,8 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, uno::Reference< contai
{
Any aAny;
SfxModule* pModule( pDoc->GetFactory().GetModule() );
rtl::OUString aSlotCmd( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
rtl::OUString aUnoCmd( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ));
rtl::OUString aSlotCmd( "slot:" );
rtl::OUString aUnoCmd( ".uno:" );
uno::Sequence< beans::PropertyValue > aSeqPropValue;
for ( sal_Int32 i = 0; i < rToolbarDefinition->getCount(); i++ )
@ -3343,7 +3343,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig
{
uno::Reference< ui::XUIConfigurationManager > xNewUIConfMan(
::comphelper::getProcessServiceFactory()->createInstance(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager"))),
::rtl::OUString("com.sun.star.ui.UIConfigurationManager")),
uno::UNO_QUERY );
Reference< ui::XUIConfigurationStorage > xUIConfigStorage( xNewUIConfMan, uno::UNO_QUERY );
@ -3351,14 +3351,14 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig
{
uno::Reference< XSTORAGE > xConfigStorage;
rtl::OUString aUIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" ));
rtl::OUString aUIConfigFolderName( "Configurations2" );
// First try to open with READWRITE and then READ
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, embed::ElementModes::READWRITE );
if ( xConfigStorage.is() )
{
rtl::OUString aMediaTypeProp( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ));
rtl::OUString aMediaTypeProp( "MediaType" );
rtl::OUString aUIConfigMediaType(
RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.xml.ui.configuration" ) );
"application/vnd.sun.xml.ui.configuration" );
rtl::OUString aMediaType;
uno::Reference< beans::XPropertySet > xPropSet( xConfigStorage, uno::UNO_QUERY );
Any a = xPropSet->getPropertyValue( aMediaTypeProp );
@ -3380,7 +3380,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig
{
// Import old UI configuration from OOo 1.x
uno::Reference< XSTORAGE > xOOo1ConfigStorage;
rtl::OUString aOOo1UIConfigFolderName( RTL_CONSTASCII_USTRINGPARAM( "Configurations" ));
rtl::OUString aOOo1UIConfigFolderName( "Configurations" );
// Try to open with READ
xOOo1ConfigStorage = getDocumentSubStorage( aOOo1UIConfigFolderName, embed::ElementModes::READ );
@ -3412,7 +3412,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig
{
try
{
rtl::OUString aPropName( RTL_CONSTASCII_USTRINGPARAM( "UIName" ));
rtl::OUString aPropName( "UIName" );
Any aAny( aCustomTbxTitle );
xPropSet->setPropertyValue( aPropName, aAny );
}
@ -3511,8 +3511,8 @@ embed::VisualRepresentation SAL_CALL SfxBaseModel::getPreferredVisualRepresentat
SfxModelGuard aGuard( *this );
datatransfer::DataFlavor aDataFlavor(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GDIMetaFile")),
::rtl::OUString("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ),
::rtl::OUString("GDIMetaFile"),
::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
embed::VisualRepresentation aVisualRepresentation;
@ -3739,7 +3739,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper ()
if ( ! m_pData->m_xTitleHelper.is ())
{
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory ();
static const ::rtl::OUString SERVICENAME_DESKTOP(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"));
static const ::rtl::OUString SERVICENAME_DESKTOP("com.sun.star.frame.Desktop");
css::uno::Reference< css::frame::XUntitledNumbers > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::frame::XModel > xThis (static_cast< css::frame::XModel* >(this), css::uno::UNO_QUERY_THROW);
@ -3765,7 +3765,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
m_pData->m_xNumberedControllers = css::uno::Reference< css::frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), css::uno::UNO_QUERY_THROW);
pHelper->setOwner (xThis);
pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : ")));
pHelper->setUntitledPrefix (::rtl::OUString(" : "));
}
return m_pData->m_xNumberedControllers;
@ -3792,7 +3792,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
= aContent.getProperties();
if ( xProps.is() )
{
::rtl::OUString aServerTitle( RTL_CONSTASCII_USTRINGPARAM("TitleOnServer") );
::rtl::OUString aServerTitle( "TitleOnServer" );
if ( xProps->hasPropertyByName( aServerTitle ) )
{
uno::Any aAny = aContent.getPropertyValue( aServerTitle );
@ -4148,8 +4148,8 @@ SfxBaseModel::getRDFRepository() throw (uno::RuntimeException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getRDFRepository();
@ -4163,8 +4163,8 @@ SfxBaseModel::getStringValue() throw (uno::RuntimeException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getStringValue();
@ -4178,8 +4178,8 @@ SfxBaseModel::getNamespace() throw (uno::RuntimeException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getNamespace();
@ -4192,8 +4192,8 @@ SfxBaseModel::getLocalName() throw (uno::RuntimeException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getLocalName();
@ -4209,8 +4209,8 @@ throw (uno::RuntimeException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getElementByMetadataReference(i_rReference);
@ -4224,8 +4224,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getElementByURI(i_xURI);
@ -4240,8 +4240,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException)
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->getMetadataGraphsWithType(i_xType);
@ -4257,8 +4257,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->addMetadataFile(i_rFileName, i_rTypes);
@ -4278,8 +4278,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->importMetadataFile(i_Format,
@ -4296,8 +4296,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->removeMetadataFile(i_xGraphName);
@ -4312,8 +4312,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->addContentOrStylesFile(i_rFileName);
@ -4328,8 +4328,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->removeContentOrStylesFile(i_rFileName);
@ -4348,8 +4348,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
try {
@ -4375,8 +4375,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->storeMetadataToStorage(i_xStorage);
@ -4393,8 +4393,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
try {
@ -4419,8 +4419,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
throw uno::RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"model has no document metadata")), *this );
throw uno::RuntimeException( ::rtl::OUString(
"model has no document metadata"), *this );
}
return xDMA->storeMetadataToMedium(i_rMedium);