| File: | stoc/source/simpleregistry/textualservices.cxx |
| Location: | line 1043, column 57 |
| Description: | Called C++ object pointer is null |
| 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |||
| 2 | /* | |||
| 3 | * This file is part of the LibreOffice project. | |||
| 4 | * | |||
| 5 | * This Source Code Form is subject to the terms of the Mozilla Public | |||
| 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | |||
| 7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | |||
| 8 | * | |||
| 9 | * This file incorporates work covered by the following license notice: | |||
| 10 | * | |||
| 11 | * Licensed to the Apache Software Foundation (ASF) under one or more | |||
| 12 | * contributor license agreements. See the NOTICE file distributed | |||
| 13 | * with this work for additional information regarding copyright | |||
| 14 | * ownership. The ASF licenses this file to you under the Apache | |||
| 15 | * License, Version 2.0 (the "License"); you may not use this file | |||
| 16 | * except in compliance with the License. You may obtain a copy of | |||
| 17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | |||
| 18 | */ | |||
| 19 | ||||
| 20 | #include "sal/config.h" | |||
| 21 | ||||
| 22 | #include <cstddef> | |||
| 23 | #include <cstdlib> | |||
| 24 | #include <map> | |||
| 25 | #include <vector> | |||
| 26 | ||||
| 27 | #include "boost/noncopyable.hpp" | |||
| 28 | #include "com/sun/star/container/NoSuchElementException.hpp" | |||
| 29 | #include "com/sun/star/registry/InvalidRegistryException.hpp" | |||
| 30 | #include "com/sun/star/registry/XRegistryKey.hpp" | |||
| 31 | #include "com/sun/star/uno/Reference.hxx" | |||
| 32 | #include "com/sun/star/uno/XInterface.hpp" | |||
| 33 | #include "cppuhelper/implbase1.hxx" | |||
| 34 | #include "osl/diagnose.h" | |||
| 35 | #include "rtl/malformeduriexception.hxx" | |||
| 36 | #include "rtl/ref.hxx" | |||
| 37 | #include "rtl/string.h" | |||
| 38 | #include "rtl/uri.hxx" | |||
| 39 | #include "rtl/ustrbuf.hxx" | |||
| 40 | #include "rtl/ustring.h" | |||
| 41 | #include "rtl/ustring.hxx" | |||
| 42 | #include "salhelper/simplereferenceobject.hxx" | |||
| 43 | #include "xmlreader/span.hxx" | |||
| 44 | #include "xmlreader/xmlreader.hxx" | |||
| 45 | ||||
| 46 | #include "textualservices.hxx" | |||
| 47 | ||||
| 48 | namespace stoc { namespace simpleregistry { | |||
| 49 | ||||
| 50 | namespace { | |||
| 51 | ||||
| 52 | namespace css = com::sun::star; | |||
| 53 | ||||
| 54 | struct Implementation { | |||
| 55 | rtl::OUString uri; | |||
| 56 | rtl::OUString loader; | |||
| 57 | rtl::OUString prefix; | |||
| 58 | std::vector< rtl::OUString > services; | |||
| 59 | std::vector< rtl::OUString > singletons; | |||
| 60 | }; | |||
| 61 | ||||
| 62 | typedef std::map< rtl::OUString, Implementation > Implementations; | |||
| 63 | ||||
| 64 | typedef std::map< rtl::OUString, std::vector< rtl::OUString > > | |||
| 65 | ImplementationMap; | |||
| 66 | ||||
| 67 | } | |||
| 68 | ||||
| 69 | class Data: public salhelper::SimpleReferenceObject, private boost::noncopyable | |||
| 70 | { | |||
| 71 | public: | |||
| 72 | Implementations implementations; | |||
| 73 | ImplementationMap services; | |||
| 74 | ImplementationMap singletons; | |||
| 75 | }; | |||
| 76 | ||||
| 77 | namespace { | |||
| 78 | ||||
| 79 | class Parser: private boost::noncopyable { | |||
| 80 | public: | |||
| 81 | Parser(rtl::OUString const & uri, rtl::Reference< Data > const & data); | |||
| 82 | ||||
| 83 | private: | |||
| 84 | void handleComponent(); | |||
| 85 | ||||
| 86 | void handleImplementation(); | |||
| 87 | ||||
| 88 | void handleService(); | |||
| 89 | ||||
| 90 | void handleSingleton(); | |||
| 91 | ||||
| 92 | rtl::OUString getNameAttribute(); | |||
| 93 | ||||
| 94 | xmlreader::XmlReader reader_; | |||
| 95 | rtl::Reference< Data > data_; | |||
| 96 | rtl::OUString attrUri_; | |||
| 97 | rtl::OUString attrLoader_; | |||
| 98 | rtl::OUString attrPrefix_; | |||
| 99 | rtl::OUString attrImplementation_; | |||
| 100 | }; | |||
| 101 | ||||
| 102 | Parser::Parser(rtl::OUString const & uri, rtl::Reference< Data > const & data): | |||
| 103 | reader_(uri), data_(data) | |||
| 104 | { | |||
| 105 | OSL_ASSERT(data.is())do { if (true && (!(data.is()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "105" ": "), "OSL_ASSERT: %s", "data.is()"); } } while ( false); | |||
| 106 | int ucNsId = reader_.registerNamespaceIri( | |||
| 107 | xmlreader::Span( | |||
| 108 | RTL_CONSTASCII_STRINGPARAM((&("http://openoffice.org/2010/uno-components")[0]), ((sal_Int32 )(sizeof ("http://openoffice.org/2010/uno-components") / sizeof (("http://openoffice.org/2010/uno-components")[0]))-1) | |||
| 109 | "http://openoffice.org/2010/uno-components")(&("http://openoffice.org/2010/uno-components")[0]), ((sal_Int32 )(sizeof ("http://openoffice.org/2010/uno-components") / sizeof (("http://openoffice.org/2010/uno-components")[0]))-1))); | |||
| 110 | enum State { | |||
| 111 | STATE_BEGIN, STATE_END, STATE_COMPONENTS, STATE_COMPONENT_INITIAL, | |||
| 112 | STATE_COMPONENT, STATE_IMPLEMENTATION, STATE_SERVICE, STATE_SINGLETON }; | |||
| 113 | for (State state = STATE_BEGIN;;) { | |||
| 114 | xmlreader::Span name; | |||
| 115 | int nsId; | |||
| 116 | xmlreader::XmlReader::Result res = reader_.nextItem( | |||
| 117 | xmlreader::XmlReader::TEXT_NONE, &name, &nsId); | |||
| 118 | switch (state) { | |||
| 119 | case STATE_BEGIN: | |||
| 120 | if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId && | |||
| 121 | name.equals(RTL_CONSTASCII_STRINGPARAM("components")(&("components")[0]), ((sal_Int32)(sizeof ("components") / sizeof (("components")[0]))-1))) | |||
| 122 | { | |||
| 123 | state = STATE_COMPONENTS; | |||
| 124 | break; | |||
| 125 | } | |||
| 126 | throw css::registry::InvalidRegistryException( | |||
| 127 | (reader_.getUrl() + | |||
| 128 | rtl::OUString( | |||
| 129 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in outer level")[0]), ((sal_Int32)( (sizeof (": unexpected item in outer level") / sizeof ((": unexpected item in outer level" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 130 | ": unexpected item in outer level")(&(": unexpected item in outer level")[0]), ((sal_Int32)( (sizeof (": unexpected item in outer level") / sizeof ((": unexpected item in outer level" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 131 | css::uno::Reference< css::uno::XInterface >()); | |||
| 132 | case STATE_END: | |||
| 133 | if (res == xmlreader::XmlReader::RESULT_DONE) { | |||
| 134 | return; | |||
| 135 | } | |||
| 136 | throw css::registry::InvalidRegistryException( | |||
| 137 | (reader_.getUrl() + | |||
| 138 | rtl::OUString( | |||
| 139 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in outer level")[0]), ((sal_Int32)( (sizeof (": unexpected item in outer level") / sizeof ((": unexpected item in outer level" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 140 | ": unexpected item in outer level")(&(": unexpected item in outer level")[0]), ((sal_Int32)( (sizeof (": unexpected item in outer level") / sizeof ((": unexpected item in outer level" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 141 | css::uno::Reference< css::uno::XInterface >()); | |||
| 142 | case STATE_COMPONENTS: | |||
| 143 | if (res == xmlreader::XmlReader::RESULT_END) { | |||
| 144 | state = STATE_END; | |||
| 145 | break; | |||
| 146 | } | |||
| 147 | if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId && | |||
| 148 | name.equals(RTL_CONSTASCII_STRINGPARAM("component")(&("component")[0]), ((sal_Int32)(sizeof ("component") / sizeof (("component")[0]))-1))) | |||
| 149 | { | |||
| 150 | handleComponent(); | |||
| 151 | state = STATE_COMPONENT_INITIAL; | |||
| 152 | break; | |||
| 153 | } | |||
| 154 | throw css::registry::InvalidRegistryException( | |||
| 155 | (reader_.getUrl() + | |||
| 156 | rtl::OUString( | |||
| 157 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in <components>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <components>") / sizeof ((": unexpected item in <components>")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 158 | ": unexpected item in <components>")(&(": unexpected item in <components>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <components>") / sizeof ((": unexpected item in <components>")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 159 | css::uno::Reference< css::uno::XInterface >()); | |||
| 160 | case STATE_COMPONENT: | |||
| 161 | if (res == xmlreader::XmlReader::RESULT_END) { | |||
| 162 | state = STATE_COMPONENTS; | |||
| 163 | break; | |||
| 164 | } | |||
| 165 | // fall through | |||
| 166 | case STATE_COMPONENT_INITIAL: | |||
| 167 | if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId && | |||
| 168 | name.equals(RTL_CONSTASCII_STRINGPARAM("implementation")(&("implementation")[0]), ((sal_Int32)(sizeof ("implementation" ) / sizeof (("implementation")[0]))-1))) | |||
| 169 | { | |||
| 170 | handleImplementation(); | |||
| 171 | state = STATE_IMPLEMENTATION; | |||
| 172 | break; | |||
| 173 | } | |||
| 174 | throw css::registry::InvalidRegistryException( | |||
| 175 | (reader_.getUrl() + | |||
| 176 | rtl::OUString( | |||
| 177 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in <component>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <component>") / sizeof ((": unexpected item in <component>")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 178 | ": unexpected item in <component>")(&(": unexpected item in <component>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <component>") / sizeof ((": unexpected item in <component>")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 179 | css::uno::Reference< css::uno::XInterface >()); | |||
| 180 | case STATE_IMPLEMENTATION: | |||
| 181 | if (res == xmlreader::XmlReader::RESULT_END) { | |||
| 182 | state = STATE_COMPONENT; | |||
| 183 | break; | |||
| 184 | } | |||
| 185 | if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId && | |||
| 186 | name.equals(RTL_CONSTASCII_STRINGPARAM("service")(&("service")[0]), ((sal_Int32)(sizeof ("service") / sizeof (("service")[0]))-1))) | |||
| 187 | { | |||
| 188 | handleService(); | |||
| 189 | state = STATE_SERVICE; | |||
| 190 | break; | |||
| 191 | } | |||
| 192 | if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId && | |||
| 193 | name.equals(RTL_CONSTASCII_STRINGPARAM("singleton")(&("singleton")[0]), ((sal_Int32)(sizeof ("singleton") / sizeof (("singleton")[0]))-1))) | |||
| 194 | { | |||
| 195 | handleSingleton(); | |||
| 196 | state = STATE_SINGLETON; | |||
| 197 | break; | |||
| 198 | } | |||
| 199 | throw css::registry::InvalidRegistryException( | |||
| 200 | (reader_.getUrl() + | |||
| 201 | rtl::OUString( | |||
| 202 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in <implementation>")[0]), (( sal_Int32)((sizeof (": unexpected item in <implementation>" ) / sizeof ((": unexpected item in <implementation>")[0 ]))-1)), (((rtl_TextEncoding) 11)) | |||
| 203 | ": unexpected item in <implementation>")(&(": unexpected item in <implementation>")[0]), (( sal_Int32)((sizeof (": unexpected item in <implementation>" ) / sizeof ((": unexpected item in <implementation>")[0 ]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 204 | css::uno::Reference< css::uno::XInterface >()); | |||
| 205 | case STATE_SERVICE: | |||
| 206 | if (res == xmlreader::XmlReader::RESULT_END) { | |||
| 207 | state = STATE_IMPLEMENTATION; | |||
| 208 | break; | |||
| 209 | } | |||
| 210 | throw css::registry::InvalidRegistryException( | |||
| 211 | (reader_.getUrl() + | |||
| 212 | rtl::OUString( | |||
| 213 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in <service>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <service>") / sizeof ( (": unexpected item in <service>")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 214 | ": unexpected item in <service>")(&(": unexpected item in <service>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <service>") / sizeof ( (": unexpected item in <service>")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 215 | css::uno::Reference< css::uno::XInterface >()); | |||
| 216 | case STATE_SINGLETON: | |||
| 217 | if (res == xmlreader::XmlReader::RESULT_END) { | |||
| 218 | state = STATE_IMPLEMENTATION; | |||
| 219 | break; | |||
| 220 | } | |||
| 221 | throw css::registry::InvalidRegistryException( | |||
| 222 | (reader_.getUrl() + | |||
| 223 | rtl::OUString( | |||
| 224 | RTL_CONSTASCII_USTRINGPARAM((&(": unexpected item in <service>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <service>") / sizeof ( (": unexpected item in <service>")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 225 | ": unexpected item in <service>")(&(": unexpected item in <service>")[0]), ((sal_Int32 )((sizeof (": unexpected item in <service>") / sizeof ( (": unexpected item in <service>")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 226 | css::uno::Reference< css::uno::XInterface >()); | |||
| 227 | } | |||
| 228 | } | |||
| 229 | } | |||
| 230 | ||||
| 231 | void Parser::handleComponent() { | |||
| 232 | attrUri_ = rtl::OUString(); | |||
| 233 | attrLoader_ = rtl::OUString(); | |||
| 234 | attrPrefix_ = rtl::OUString(); | |||
| 235 | xmlreader::Span name; | |||
| 236 | int nsId; | |||
| 237 | while (reader_.nextAttribute(&nsId, &name)) { | |||
| 238 | if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && | |||
| 239 | name.equals(RTL_CONSTASCII_STRINGPARAM("uri")(&("uri")[0]), ((sal_Int32)(sizeof ("uri") / sizeof (("uri" )[0]))-1))) | |||
| 240 | { | |||
| 241 | if (!attrUri_.isEmpty()) { | |||
| 242 | throw css::registry::InvalidRegistryException( | |||
| 243 | (reader_.getUrl() + | |||
| 244 | rtl::OUString( | |||
| 245 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has multiple \"uri\" attributes") [0]), ((sal_Int32)((sizeof (": <component> has multiple \"uri\" attributes" ) / sizeof ((": <component> has multiple \"uri\" attributes" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 246 | ": <component> has multiple \"uri\" attributes")(&(": <component> has multiple \"uri\" attributes") [0]), ((sal_Int32)((sizeof (": <component> has multiple \"uri\" attributes" ) / sizeof ((": <component> has multiple \"uri\" attributes" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 247 | css::uno::Reference< css::uno::XInterface >()); | |||
| 248 | } | |||
| 249 | attrUri_ = reader_.getAttributeValue(false).convertFromUtf8(); | |||
| 250 | if (attrUri_.isEmpty()) { | |||
| 251 | throw css::registry::InvalidRegistryException( | |||
| 252 | (reader_.getUrl() + | |||
| 253 | rtl::OUString( | |||
| 254 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has empty \"uri\" attribute")[0]) , ((sal_Int32)((sizeof (": <component> has empty \"uri\" attribute" ) / sizeof ((": <component> has empty \"uri\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 255 | ": <component> has empty \"uri\" attribute")(&(": <component> has empty \"uri\" attribute")[0]) , ((sal_Int32)((sizeof (": <component> has empty \"uri\" attribute" ) / sizeof ((": <component> has empty \"uri\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 256 | css::uno::Reference< css::uno::XInterface >()); | |||
| 257 | } | |||
| 258 | } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && | |||
| 259 | name.equals(RTL_CONSTASCII_STRINGPARAM("loader")(&("loader")[0]), ((sal_Int32)(sizeof ("loader") / sizeof (("loader")[0]))-1))) | |||
| 260 | { | |||
| 261 | if (!attrLoader_.isEmpty()) { | |||
| 262 | throw css::registry::InvalidRegistryException( | |||
| 263 | (reader_.getUrl() + | |||
| 264 | rtl::OUString( | |||
| 265 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has multiple \"loader\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"loader\"" " attributes") / sizeof ((": <component> has multiple \"loader\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 266 | ": <component> has multiple \"loader\""(&(": <component> has multiple \"loader\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"loader\"" " attributes") / sizeof ((": <component> has multiple \"loader\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 267 | " attributes")(&(": <component> has multiple \"loader\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"loader\"" " attributes") / sizeof ((": <component> has multiple \"loader\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 268 | css::uno::Reference< css::uno::XInterface >()); | |||
| 269 | } | |||
| 270 | attrLoader_ = reader_.getAttributeValue(false).convertFromUtf8(); | |||
| 271 | if (attrLoader_.isEmpty()) { | |||
| 272 | throw css::registry::InvalidRegistryException( | |||
| 273 | (reader_.getUrl() + | |||
| 274 | rtl::OUString( | |||
| 275 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has empty \"loader\" attribute")[ 0]), ((sal_Int32)((sizeof (": <component> has empty \"loader\" attribute" ) / sizeof ((": <component> has empty \"loader\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 276 | ": <component> has empty \"loader\" attribute")(&(": <component> has empty \"loader\" attribute")[ 0]), ((sal_Int32)((sizeof (": <component> has empty \"loader\" attribute" ) / sizeof ((": <component> has empty \"loader\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 277 | css::uno::Reference< css::uno::XInterface >()); | |||
| 278 | } | |||
| 279 | } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && | |||
| 280 | name.equals(RTL_CONSTASCII_STRINGPARAM("prefix")(&("prefix")[0]), ((sal_Int32)(sizeof ("prefix") / sizeof (("prefix")[0]))-1))) | |||
| 281 | { | |||
| 282 | if (!attrPrefix_.isEmpty()) { | |||
| 283 | throw css::registry::InvalidRegistryException( | |||
| 284 | (reader_.getUrl() + | |||
| 285 | rtl::OUString( | |||
| 286 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has multiple \"prefix\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"prefix\"" " attributes") / sizeof ((": <component> has multiple \"prefix\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 287 | ": <component> has multiple \"prefix\""(&(": <component> has multiple \"prefix\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"prefix\"" " attributes") / sizeof ((": <component> has multiple \"prefix\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 288 | " attributes")(&(": <component> has multiple \"prefix\"" " attributes" )[0]), ((sal_Int32)((sizeof (": <component> has multiple \"prefix\"" " attributes") / sizeof ((": <component> has multiple \"prefix\"" " attributes")[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 289 | css::uno::Reference< css::uno::XInterface >()); | |||
| 290 | } | |||
| 291 | attrPrefix_ = reader_.getAttributeValue(false).convertFromUtf8(); | |||
| 292 | if (attrPrefix_.isEmpty()) { | |||
| 293 | throw css::registry::InvalidRegistryException( | |||
| 294 | (reader_.getUrl() + | |||
| 295 | rtl::OUString( | |||
| 296 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> has empty \"prefix\" attribute")[ 0]), ((sal_Int32)((sizeof (": <component> has empty \"prefix\" attribute" ) / sizeof ((": <component> has empty \"prefix\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 297 | ": <component> has empty \"prefix\" attribute")(&(": <component> has empty \"prefix\" attribute")[ 0]), ((sal_Int32)((sizeof (": <component> has empty \"prefix\" attribute" ) / sizeof ((": <component> has empty \"prefix\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 298 | css::uno::Reference< css::uno::XInterface >()); | |||
| 299 | } | |||
| 300 | } else { | |||
| 301 | OSL_FAIL ("unexpected component attribute, expected 'uri' or 'loader' or 'prefix'")do { if (true && (((sal_Bool)1))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "301" ": "), "%s", "unexpected component attribute, expected 'uri' or 'loader' or 'prefix'" ); } } while (false); | |||
| 302 | } | |||
| 303 | } | |||
| 304 | if (attrUri_.isEmpty()) { | |||
| 305 | throw css::registry::InvalidRegistryException( | |||
| 306 | (reader_.getUrl() + | |||
| 307 | rtl::OUString( | |||
| 308 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> is missing \"uri\" attribute")[0] ), ((sal_Int32)((sizeof (": <component> is missing \"uri\" attribute" ) / sizeof ((": <component> is missing \"uri\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 309 | ": <component> is missing \"uri\" attribute")(&(": <component> is missing \"uri\" attribute")[0] ), ((sal_Int32)((sizeof (": <component> is missing \"uri\" attribute" ) / sizeof ((": <component> is missing \"uri\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 310 | css::uno::Reference< css::uno::XInterface >()); | |||
| 311 | } | |||
| 312 | if (attrLoader_.isEmpty()) { | |||
| 313 | throw css::registry::InvalidRegistryException( | |||
| 314 | (reader_.getUrl() + | |||
| 315 | rtl::OUString( | |||
| 316 | RTL_CONSTASCII_USTRINGPARAM((&(": <component> is missing \"loader\" attribute") [0]), ((sal_Int32)((sizeof (": <component> is missing \"loader\" attribute" ) / sizeof ((": <component> is missing \"loader\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 317 | ": <component> is missing \"loader\" attribute")(&(": <component> is missing \"loader\" attribute") [0]), ((sal_Int32)((sizeof (": <component> is missing \"loader\" attribute" ) / sizeof ((": <component> is missing \"loader\" attribute" )[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 318 | css::uno::Reference< css::uno::XInterface >()); | |||
| 319 | } | |||
| 320 | #ifndef DISABLE_DYNLOADING | |||
| 321 | try { | |||
| 322 | attrUri_ = rtl::Uri::convertRelToAbs(reader_.getUrl(), attrUri_); | |||
| 323 | } catch (const rtl::MalformedUriException & e) { | |||
| 324 | throw css::registry::InvalidRegistryException( | |||
| 325 | (reader_.getUrl() + | |||
| 326 | rtl::OUString( | |||
| 327 | RTL_CONSTASCII_USTRINGPARAM(": bad \"uri\" attribute: ")(&(": bad \"uri\" attribute: ")[0]), ((sal_Int32)((sizeof (": bad \"uri\" attribute: ") / sizeof ((": bad \"uri\" attribute: " )[0]))-1)), (((rtl_TextEncoding) 11))) + | |||
| 328 | e.getMessage()), | |||
| 329 | css::uno::Reference< css::uno::XInterface >()); | |||
| 330 | } | |||
| 331 | #endif | |||
| 332 | } | |||
| 333 | ||||
| 334 | void Parser::handleImplementation() { | |||
| 335 | attrImplementation_ = getNameAttribute(); | |||
| 336 | if (data_->implementations.find(attrImplementation_) != | |||
| 337 | data_->implementations.end()) | |||
| 338 | { | |||
| 339 | throw css::registry::InvalidRegistryException( | |||
| 340 | (reader_.getUrl() + | |||
| 341 | rtl::OUString( | |||
| 342 | RTL_CONSTASCII_USTRINGPARAM((&(": duplicate <implementation name=\"")[0]), ((sal_Int32 )((sizeof (": duplicate <implementation name=\"") / sizeof ((": duplicate <implementation name=\"")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 343 | ": duplicate <implementation name=\"")(&(": duplicate <implementation name=\"")[0]), ((sal_Int32 )((sizeof (": duplicate <implementation name=\"") / sizeof ((": duplicate <implementation name=\"")[0]))-1)), (((rtl_TextEncoding ) 11))) + | |||
| 344 | attrImplementation_ + | |||
| 345 | rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\">")(&("\">")[0]), ((sal_Int32)((sizeof ("\">") / sizeof (("\">")[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 346 | css::uno::Reference< css::uno::XInterface >()); | |||
| 347 | } | |||
| 348 | data_->implementations[attrImplementation_].uri = attrUri_; | |||
| 349 | data_->implementations[attrImplementation_].loader = attrLoader_; | |||
| 350 | data_->implementations[attrImplementation_].prefix = attrPrefix_; | |||
| 351 | } | |||
| 352 | ||||
| 353 | void Parser::handleService() { | |||
| 354 | rtl::OUString name = getNameAttribute(); | |||
| 355 | data_->implementations[attrImplementation_].services.push_back(name); | |||
| 356 | data_->services[name].push_back(attrImplementation_); | |||
| 357 | } | |||
| 358 | ||||
| 359 | void Parser::handleSingleton() { | |||
| 360 | rtl::OUString name = getNameAttribute(); | |||
| 361 | data_->implementations[attrImplementation_].singletons.push_back(name); | |||
| 362 | data_->singletons[name].push_back(attrImplementation_); | |||
| 363 | } | |||
| 364 | ||||
| 365 | rtl::OUString Parser::getNameAttribute() { | |||
| 366 | rtl::OUString attrName; | |||
| 367 | xmlreader::Span name; | |||
| 368 | int nsId; | |||
| 369 | while (reader_.nextAttribute(&nsId, &name)) { | |||
| 370 | if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && | |||
| 371 | name.equals(RTL_CONSTASCII_STRINGPARAM("name")(&("name")[0]), ((sal_Int32)(sizeof ("name") / sizeof (("name" )[0]))-1))) | |||
| 372 | { | |||
| 373 | if (!attrName.isEmpty()) { | |||
| 374 | throw css::registry::InvalidRegistryException( | |||
| 375 | (reader_.getUrl() + | |||
| 376 | rtl::OUString( | |||
| 377 | RTL_CONSTASCII_USTRINGPARAM((&(": element has multiple \"name\" attributes")[0]), ((sal_Int32 )((sizeof (": element has multiple \"name\" attributes") / sizeof ((": element has multiple \"name\" attributes")[0]))-1)), (( (rtl_TextEncoding) 11)) | |||
| 378 | ": element has multiple \"name\" attributes")(&(": element has multiple \"name\" attributes")[0]), ((sal_Int32 )((sizeof (": element has multiple \"name\" attributes") / sizeof ((": element has multiple \"name\" attributes")[0]))-1)), (( (rtl_TextEncoding) 11)))), | |||
| 379 | css::uno::Reference< css::uno::XInterface >()); | |||
| 380 | } | |||
| 381 | attrName = reader_.getAttributeValue(false).convertFromUtf8(); | |||
| 382 | if (attrName.isEmpty()) { | |||
| 383 | throw css::registry::InvalidRegistryException( | |||
| 384 | (reader_.getUrl() + | |||
| 385 | rtl::OUString( | |||
| 386 | RTL_CONSTASCII_USTRINGPARAM((&(": element has empty \"name\" attribute")[0]), ((sal_Int32 )((sizeof (": element has empty \"name\" attribute") / sizeof ((": element has empty \"name\" attribute")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 387 | ": element has empty \"name\" attribute")(&(": element has empty \"name\" attribute")[0]), ((sal_Int32 )((sizeof (": element has empty \"name\" attribute") / sizeof ((": element has empty \"name\" attribute")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 388 | css::uno::Reference< css::uno::XInterface >()); | |||
| 389 | } | |||
| 390 | } else { | |||
| 391 | throw css::registry::InvalidRegistryException( | |||
| 392 | (reader_.getUrl() + | |||
| 393 | rtl::OUString( | |||
| 394 | RTL_CONSTASCII_USTRINGPARAM((&(": expected element attribute \"name\"")[0]), ((sal_Int32 )((sizeof (": expected element attribute \"name\"") / sizeof ( (": expected element attribute \"name\"")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 395 | ": expected element attribute \"name\"")(&(": expected element attribute \"name\"")[0]), ((sal_Int32 )((sizeof (": expected element attribute \"name\"") / sizeof ( (": expected element attribute \"name\"")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 396 | css::uno::Reference< css::uno::XInterface >()); | |||
| 397 | } | |||
| 398 | } | |||
| 399 | if (attrName.isEmpty()) { | |||
| 400 | throw css::registry::InvalidRegistryException( | |||
| 401 | (reader_.getUrl() + | |||
| 402 | rtl::OUString( | |||
| 403 | RTL_CONSTASCII_USTRINGPARAM((&(": element is missing \"name\" attribute")[0]), ((sal_Int32 )((sizeof (": element is missing \"name\" attribute") / sizeof ((": element is missing \"name\" attribute")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 404 | ": element is missing \"name\" attribute")(&(": element is missing \"name\" attribute")[0]), ((sal_Int32 )((sizeof (": element is missing \"name\" attribute") / sizeof ((": element is missing \"name\" attribute")[0]))-1)), (((rtl_TextEncoding ) 11)))), | |||
| 405 | css::uno::Reference< css::uno::XInterface >()); | |||
| 406 | } | |||
| 407 | return attrName; | |||
| 408 | } | |||
| 409 | ||||
| 410 | rtl::OUString pathToString(std::vector< rtl::OUString > const & path) { | |||
| 411 | rtl::OUStringBuffer buf; | |||
| 412 | for (std::vector< rtl::OUString >::const_iterator i(path.begin()); | |||
| 413 | i != path.end(); ++i) | |||
| 414 | { | |||
| 415 | buf.append(sal_Unicode('/')); | |||
| 416 | buf.append(*i); | |||
| 417 | } | |||
| 418 | if (buf.getLength() == 0) { | |||
| 419 | buf.append(sal_Unicode('/')); | |||
| 420 | } | |||
| 421 | return buf.makeStringAndClear(); | |||
| 422 | } | |||
| 423 | ||||
| 424 | class Key: public cppu::WeakImplHelper1< css::registry::XRegistryKey > { | |||
| 425 | public: | |||
| 426 | Key( | |||
| 427 | rtl::Reference< Data > const & data, | |||
| 428 | std::vector< rtl::OUString > const & path): | |||
| 429 | data_(data), path_(path) { OSL_ASSERT(data.is())do { if (true && (!(data.is()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "429" ": "), "OSL_ASSERT: %s", "data.is()"); } } while ( false); | |||
| 430 | } | |||
| 431 | ||||
| 432 | private: | |||
| 433 | /* | |||
| 434 | / | |||
| 435 | IMPLEMENTATIONS | |||
| 436 | <implementation> | |||
| 437 | UNO | |||
| 438 | LOCATION utf-8 | |||
| 439 | ACTIVATOR utf-8 | |||
| 440 | PREFIX utf-8 | |||
| 441 | SERVICES | |||
| 442 | <service> | |||
| 443 | ... | |||
| 444 | SINGLETONS | |||
| 445 | <singleton> utf-16 | |||
| 446 | ... | |||
| 447 | ... | |||
| 448 | SERVICES | |||
| 449 | <service> utf-8-list | |||
| 450 | ... | |||
| 451 | SINGLETONS | |||
| 452 | <singleton> utf-16 | |||
| 453 | REGISTERED_BY utf-8-list | |||
| 454 | ... | |||
| 455 | */ | |||
| 456 | enum State { | |||
| 457 | STATE_ROOT, STATE_IMPLEMENTATIONS, STATE_IMPLEMENTATION, STATE_UNO, | |||
| 458 | STATE_LOCATION, STATE_ACTIVATOR, STATE_PREFIX, STATE_IMPLEMENTATION_SERVICES, | |||
| 459 | STATE_IMPLEMENTATION_SERVICE, STATE_IMPLEMENTATION_SINGLETONS, | |||
| 460 | STATE_IMPLEMENTATION_SINGLETON, STATE_SERVICES, STATE_SERVICE, | |||
| 461 | STATE_SINGLETONS, STATE_SINGLETON, STATE_REGISTEREDBY }; | |||
| 462 | ||||
| 463 | virtual rtl::OUString SAL_CALL getKeyName() | |||
| 464 | throw (css::uno::RuntimeException); | |||
| 465 | ||||
| 466 | virtual sal_Bool SAL_CALL isReadOnly() throw ( | |||
| 467 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 468 | ||||
| 469 | virtual sal_Bool SAL_CALL isValid() throw(css::uno::RuntimeException); | |||
| 470 | ||||
| 471 | virtual css::registry::RegistryKeyType SAL_CALL getKeyType( | |||
| 472 | rtl::OUString const & rKeyName) | |||
| 473 | throw ( | |||
| 474 | css::registry::InvalidRegistryException, | |||
| 475 | css::uno::RuntimeException); | |||
| 476 | ||||
| 477 | virtual css::registry::RegistryValueType SAL_CALL getValueType() throw( | |||
| 478 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 479 | ||||
| 480 | virtual sal_Int32 SAL_CALL getLongValue() throw ( | |||
| 481 | css::registry::InvalidRegistryException, | |||
| 482 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 483 | ||||
| 484 | virtual void SAL_CALL setLongValue(sal_Int32 value) throw ( | |||
| 485 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 486 | ||||
| 487 | virtual css::uno::Sequence< sal_Int32 > SAL_CALL getLongListValue() throw( | |||
| 488 | css::registry::InvalidRegistryException, | |||
| 489 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 490 | ||||
| 491 | virtual void SAL_CALL setLongListValue( | |||
| 492 | com::sun::star::uno::Sequence< sal_Int32 > const & seqValue) | |||
| 493 | throw ( | |||
| 494 | css::registry::InvalidRegistryException, | |||
| 495 | css::uno::RuntimeException); | |||
| 496 | ||||
| 497 | virtual rtl::OUString SAL_CALL getAsciiValue() throw ( | |||
| 498 | css::registry::InvalidRegistryException, | |||
| 499 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 500 | ||||
| 501 | virtual void SAL_CALL setAsciiValue(rtl::OUString const & value) throw ( | |||
| 502 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 503 | ||||
| 504 | virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAsciiListValue() | |||
| 505 | throw ( | |||
| 506 | css::registry::InvalidRegistryException, | |||
| 507 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 508 | ||||
| 509 | virtual void SAL_CALL setAsciiListValue( | |||
| 510 | css::uno::Sequence< rtl::OUString > const & seqValue) | |||
| 511 | throw ( | |||
| 512 | css::registry::InvalidRegistryException, | |||
| 513 | css::uno::RuntimeException); | |||
| 514 | ||||
| 515 | virtual rtl::OUString SAL_CALL getStringValue() throw( | |||
| 516 | css::registry::InvalidRegistryException, | |||
| 517 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 518 | ||||
| 519 | virtual void SAL_CALL setStringValue(rtl::OUString const & value) throw ( | |||
| 520 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 521 | ||||
| 522 | virtual css::uno::Sequence< rtl::OUString > SAL_CALL getStringListValue() | |||
| 523 | throw ( | |||
| 524 | css::registry::InvalidRegistryException, | |||
| 525 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 526 | ||||
| 527 | virtual void SAL_CALL setStringListValue( | |||
| 528 | css::uno::Sequence< rtl::OUString > const & seqValue) | |||
| 529 | throw ( | |||
| 530 | css::registry::InvalidRegistryException, | |||
| 531 | css::uno::RuntimeException); | |||
| 532 | ||||
| 533 | virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBinaryValue() throw ( | |||
| 534 | css::registry::InvalidRegistryException, | |||
| 535 | css::registry::InvalidValueException, css::uno::RuntimeException); | |||
| 536 | ||||
| 537 | virtual void SAL_CALL setBinaryValue( | |||
| 538 | css::uno::Sequence< sal_Int8 > const & value) | |||
| 539 | throw ( | |||
| 540 | css::registry::InvalidRegistryException, | |||
| 541 | css::uno::RuntimeException); | |||
| 542 | ||||
| 543 | virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL openKey( | |||
| 544 | rtl::OUString const & aKeyName) | |||
| 545 | throw ( | |||
| 546 | css::registry::InvalidRegistryException, | |||
| 547 | css::uno::RuntimeException); | |||
| 548 | ||||
| 549 | virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL | |||
| 550 | createKey(rtl::OUString const & aKeyName) throw ( | |||
| 551 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 552 | ||||
| 553 | virtual void SAL_CALL closeKey() throw ( | |||
| 554 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 555 | ||||
| 556 | virtual void SAL_CALL deleteKey(rtl::OUString const & rKeyName) throw ( | |||
| 557 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 558 | ||||
| 559 | virtual | |||
| 560 | css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > | |||
| 561 | SAL_CALL openKeys() throw ( | |||
| 562 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 563 | ||||
| 564 | virtual css::uno::Sequence< rtl::OUString > SAL_CALL getKeyNames() throw ( | |||
| 565 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 566 | ||||
| 567 | virtual sal_Bool SAL_CALL createLink( | |||
| 568 | rtl::OUString const & aLinkName, rtl::OUString const & aLinkTarget) | |||
| 569 | throw ( | |||
| 570 | css::registry::InvalidRegistryException, | |||
| 571 | css::uno::RuntimeException); | |||
| 572 | ||||
| 573 | virtual void SAL_CALL deleteLink(rtl::OUString const & rLinkName) throw ( | |||
| 574 | css::registry::InvalidRegistryException, css::uno::RuntimeException); | |||
| 575 | ||||
| 576 | virtual rtl::OUString SAL_CALL getLinkTarget( | |||
| 577 | rtl::OUString const & rLinkName) | |||
| 578 | throw ( | |||
| 579 | css::registry::InvalidRegistryException, | |||
| 580 | css::uno::RuntimeException); | |||
| 581 | ||||
| 582 | virtual rtl::OUString SAL_CALL getResolvedName( | |||
| 583 | rtl::OUString const & aKeyName) | |||
| 584 | throw ( | |||
| 585 | css::registry::InvalidRegistryException, | |||
| 586 | css::uno::RuntimeException); | |||
| 587 | ||||
| 588 | bool find( | |||
| 589 | rtl::OUString const & relative, std::vector< rtl::OUString > * path, | |||
| 590 | State * state, css::registry::RegistryValueType * type) const; | |||
| 591 | ||||
| 592 | css::uno::Sequence< rtl::OUString > getChildren(); | |||
| 593 | ||||
| 594 | rtl::Reference< Data > data_; | |||
| 595 | std::vector< rtl::OUString > path_; | |||
| 596 | }; | |||
| 597 | ||||
| 598 | rtl::OUString Key::getKeyName() throw (css::uno::RuntimeException) { | |||
| 599 | return pathToString(path_); | |||
| 600 | } | |||
| 601 | ||||
| 602 | sal_Bool Key::isReadOnly() | |||
| 603 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 604 | { | |||
| 605 | return true; | |||
| 606 | } | |||
| 607 | ||||
| 608 | sal_Bool Key::isValid() throw(css::uno::RuntimeException) { | |||
| 609 | return true; | |||
| 610 | } | |||
| 611 | ||||
| 612 | css::registry::RegistryKeyType Key::getKeyType(rtl::OUString const & rKeyName) | |||
| 613 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 614 | { | |||
| 615 | if (!find(rtl::OUString(), 0, 0, 0)) { | |||
| 616 | throw css::registry::InvalidRegistryException( | |||
| 617 | (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown key ")(&("unknown key ")[0]), ((sal_Int32)((sizeof ("unknown key " ) / sizeof (("unknown key ")[0]))-1)), (((rtl_TextEncoding) 11 ))) + | |||
| 618 | rKeyName), | |||
| 619 | static_cast< cppu::OWeakObject * >(this)); | |||
| 620 | } | |||
| 621 | return css::registry::RegistryKeyType_KEY; | |||
| 622 | } | |||
| 623 | ||||
| 624 | css::registry::RegistryValueType Key::getValueType() | |||
| 625 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 626 | { | |||
| 627 | css::registry::RegistryValueType type = | |||
| 628 | css::registry::RegistryValueType_NOT_DEFINED; | |||
| 629 | OSL_VERIFY(find(rtl::OUString(), 0, 0, &type))do { if (!(find(rtl::OUString(), 0, 0, &type))) do { if ( true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN ), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "629" ": "), "OSL_ASSERT: %s", "0"); } } while (false); } while (0); | |||
| 630 | return type; | |||
| 631 | } | |||
| 632 | ||||
| 633 | sal_Int32 Key::getLongValue() throw ( | |||
| 634 | css::registry::InvalidRegistryException, | |||
| 635 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 636 | { | |||
| 637 | throw css::registry::InvalidValueException( | |||
| 638 | rtl::OUString( | |||
| 639 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 640 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 641 | " getLongValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 642 | static_cast< OWeakObject * >(this)); | |||
| 643 | } | |||
| 644 | ||||
| 645 | void Key::setLongValue(sal_Int32) | |||
| 646 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 647 | { | |||
| 648 | throw css::registry::InvalidRegistryException( | |||
| 649 | rtl::OUString( | |||
| 650 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 651 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 652 | " setLongValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 653 | static_cast< OWeakObject * >(this)); | |||
| 654 | } | |||
| 655 | ||||
| 656 | css::uno::Sequence< sal_Int32 > Key::getLongListValue() throw ( | |||
| 657 | css::registry::InvalidRegistryException, | |||
| 658 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 659 | { | |||
| 660 | throw css::registry::InvalidValueException( | |||
| 661 | rtl::OUString( | |||
| 662 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 663 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 664 | " getLongListValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 665 | static_cast< OWeakObject * >(this)); | |||
| 666 | } | |||
| 667 | ||||
| 668 | void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const &) | |||
| 669 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 670 | { | |||
| 671 | throw css::registry::InvalidRegistryException( | |||
| 672 | rtl::OUString( | |||
| 673 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 674 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 675 | " setLongListValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setLongListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 676 | static_cast< OWeakObject * >(this)); | |||
| 677 | } | |||
| 678 | ||||
| 679 | rtl::OUString Key::getAsciiValue() throw ( | |||
| 680 | css::registry::InvalidRegistryException, | |||
| 681 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 682 | { | |||
| 683 | State state = STATE_ROOT; | |||
| 684 | OSL_VERIFY(find(rtl::OUString(), 0, &state, 0))do { if (!(find(rtl::OUString(), 0, &state, 0))) do { if ( true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN ), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "684" ": "), "OSL_ASSERT: %s", "0"); } } while (false); } while (0); | |||
| 685 | switch (state) { | |||
| 686 | case STATE_LOCATION: | |||
| 687 | return data_->implementations[path_[1]].uri; | |||
| 688 | case STATE_ACTIVATOR: | |||
| 689 | return data_->implementations[path_[1]].loader; | |||
| 690 | case STATE_PREFIX: | |||
| 691 | return data_->implementations[path_[1]].prefix; | |||
| 692 | default: | |||
| 693 | throw css::registry::InvalidValueException( | |||
| 694 | rtl::OUString( | |||
| 695 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 696 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 697 | " getAsciiValue: wrong type")(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiValue: wrong type")[0]))-1)), (((rtl_TextEncoding) 11))), | |||
| 698 | static_cast< OWeakObject * >(this)); | |||
| 699 | } | |||
| 700 | } | |||
| 701 | ||||
| 702 | void Key::setAsciiValue(rtl::OUString const &) | |||
| 703 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 704 | { | |||
| 705 | throw css::registry::InvalidRegistryException( | |||
| 706 | rtl::OUString( | |||
| 707 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 708 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 709 | " setAsciiValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 710 | static_cast< OWeakObject * >(this)); | |||
| 711 | } | |||
| 712 | ||||
| 713 | css::uno::Sequence< rtl::OUString > Key::getAsciiListValue() throw ( | |||
| 714 | css::registry::InvalidRegistryException, | |||
| 715 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 716 | { | |||
| 717 | State state = STATE_ROOT; | |||
| 718 | OSL_VERIFY(find(rtl::OUString(), 0, &state, 0))do { if (!(find(rtl::OUString(), 0, &state, 0))) do { if ( true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN ), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "718" ": "), "OSL_ASSERT: %s", "0"); } } while (false); } while (0); | |||
| 719 | std::vector< rtl::OUString > const * list; | |||
| 720 | switch (state) { | |||
| 721 | case STATE_SERVICE: | |||
| 722 | list = &data_->services[path_[1]]; | |||
| 723 | break; | |||
| 724 | case STATE_REGISTEREDBY: | |||
| 725 | list = &data_->singletons[path_[1]]; | |||
| 726 | break; | |||
| 727 | default: | |||
| 728 | throw css::registry::InvalidValueException( | |||
| 729 | rtl::OUString( | |||
| 730 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 731 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 732 | " getAsciiListValue: wrong type")(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 733 | static_cast< OWeakObject * >(this)); | |||
| 734 | } | |||
| 735 | if (list->size() > SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) { | |||
| 736 | throw css::registry::InvalidValueException( | |||
| 737 | rtl::OUString( | |||
| 738 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 739 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 740 | " getAsciiListValue: too large")(&("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getAsciiListValue: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 741 | static_cast< OWeakObject * >(this)); | |||
| 742 | } | |||
| 743 | css::uno::Sequence< rtl::OUString > seq( | |||
| 744 | static_cast< sal_Int32 >(list->size())); | |||
| 745 | sal_Int32 i = 0; | |||
| 746 | for (std::vector< rtl::OUString >::const_iterator j(list->begin()); | |||
| 747 | j != list->end(); ++j) | |||
| 748 | { | |||
| 749 | seq[i++] = *j; | |||
| 750 | } | |||
| 751 | return seq; | |||
| 752 | } | |||
| 753 | ||||
| 754 | void Key::setAsciiListValue(css::uno::Sequence< rtl::OUString > const &) | |||
| 755 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 756 | { | |||
| 757 | throw css::registry::InvalidRegistryException( | |||
| 758 | rtl::OUString( | |||
| 759 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 760 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 761 | " setAsciiListValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setAsciiListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 762 | static_cast< OWeakObject * >(this)); | |||
| 763 | } | |||
| 764 | ||||
| 765 | rtl::OUString Key::getStringValue() throw ( | |||
| 766 | css::registry::InvalidRegistryException, | |||
| 767 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 768 | { | |||
| 769 | State state = STATE_ROOT; | |||
| 770 | OSL_VERIFY(find(rtl::OUString(), 0, &state, 0))do { if (!(find(rtl::OUString(), 0, &state, 0))) do { if ( true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN ), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "770" ": "), "OSL_ASSERT: %s", "0"); } } while (false); } while (0); | |||
| 771 | switch (state) { | |||
| 772 | case STATE_IMPLEMENTATION_SINGLETON: | |||
| 773 | case STATE_SINGLETON: | |||
| 774 | throw css::registry::InvalidRegistryException( | |||
| 775 | rtl::OUString( | |||
| 776 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 777 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 778 | " getStringValue: does not associate singletons with"(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]))-1)), (((rtl_TextEncoding) 11)) | |||
| 779 | " services")(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: does not associate singletons with" " services" )[0]))-1)), (((rtl_TextEncoding) 11))), | |||
| 780 | static_cast< OWeakObject * >(this)); | |||
| 781 | default: | |||
| 782 | break; | |||
| 783 | } | |||
| 784 | // default case extracted from switch to avoid erroneous compiler warnings | |||
| 785 | // on Solaris: | |||
| 786 | throw css::registry::InvalidValueException( | |||
| 787 | rtl::OUString( | |||
| 788 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 789 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 790 | " getStringValue: wrong type")(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringValue: wrong type")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 791 | static_cast< OWeakObject * >(this)); | |||
| 792 | } | |||
| 793 | ||||
| 794 | void Key::setStringValue(rtl::OUString const &) | |||
| 795 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 796 | { | |||
| 797 | throw css::registry::InvalidRegistryException( | |||
| 798 | rtl::OUString( | |||
| 799 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 800 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 801 | " setStringValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 802 | static_cast< OWeakObject * >(this)); | |||
| 803 | } | |||
| 804 | ||||
| 805 | css::uno::Sequence< rtl::OUString > Key::getStringListValue() throw ( | |||
| 806 | css::registry::InvalidRegistryException, | |||
| 807 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 808 | { | |||
| 809 | throw css::registry::InvalidValueException( | |||
| 810 | rtl::OUString( | |||
| 811 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 812 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 813 | " getStringListValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 814 | static_cast< OWeakObject * >(this)); | |||
| 815 | } | |||
| 816 | ||||
| 817 | void Key::setStringListValue(css::uno::Sequence< rtl::OUString > const &) | |||
| 818 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 819 | { | |||
| 820 | throw css::registry::InvalidRegistryException( | |||
| 821 | rtl::OUString( | |||
| 822 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 823 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 824 | " setStringListValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setStringListValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 825 | static_cast< OWeakObject * >(this)); | |||
| 826 | } | |||
| 827 | ||||
| 828 | css::uno::Sequence< sal_Int8 > Key::getBinaryValue() | |||
| 829 | throw ( | |||
| 830 | css::registry::InvalidRegistryException, | |||
| 831 | css::registry::InvalidValueException, css::uno::RuntimeException) | |||
| 832 | { | |||
| 833 | throw css::registry::InvalidValueException( | |||
| 834 | rtl::OUString( | |||
| 835 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 836 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 837 | " getBinarValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getBinarValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 838 | static_cast< OWeakObject * >(this)); | |||
| 839 | } | |||
| 840 | ||||
| 841 | void Key::setBinaryValue(css::uno::Sequence< sal_Int8 > const &) | |||
| 842 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 843 | { | |||
| 844 | throw css::registry::InvalidRegistryException( | |||
| 845 | rtl::OUString( | |||
| 846 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 847 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 848 | " setBinaryValue not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]), ((sal_Int32)((sizeof ( "com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported" ) / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " setBinaryValue not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 849 | static_cast< OWeakObject * >(this)); | |||
| 850 | } | |||
| 851 | ||||
| 852 | css::uno::Reference< css::registry::XRegistryKey > Key::openKey( | |||
| 853 | rtl::OUString const & aKeyName) | |||
| 854 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 855 | { | |||
| 856 | std::vector< rtl::OUString > path; | |||
| 857 | if (!find(aKeyName, &path, 0, 0)) { | |||
| 858 | return css::uno::Reference< css::registry::XRegistryKey >(); | |||
| 859 | } | |||
| 860 | return new Key(data_, path); | |||
| 861 | } | |||
| 862 | ||||
| 863 | css::uno::Reference< css::registry::XRegistryKey > Key::createKey( | |||
| 864 | rtl::OUString const &) | |||
| 865 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 866 | { | |||
| 867 | throw css::registry::InvalidRegistryException( | |||
| 868 | rtl::OUString( | |||
| 869 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 870 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 871 | " createKey not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 ))), | |||
| 872 | static_cast< OWeakObject * >(this)); | |||
| 873 | } | |||
| 874 | ||||
| 875 | void Key::closeKey() | |||
| 876 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 877 | {} | |||
| 878 | ||||
| 879 | void Key::deleteKey(rtl::OUString const &) | |||
| 880 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 881 | { | |||
| 882 | throw css::registry::InvalidRegistryException( | |||
| 883 | rtl::OUString( | |||
| 884 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 885 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 886 | " deleteKey not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteKey not supported")[0]))-1)), (((rtl_TextEncoding) 11 ))), | |||
| 887 | static_cast< OWeakObject * >(this)); | |||
| 888 | } | |||
| 889 | ||||
| 890 | css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > | |||
| 891 | Key::openKeys() | |||
| 892 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 893 | { | |||
| 894 | css::uno::Sequence< rtl::OUString > names(getChildren()); | |||
| 895 | css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > | |||
| 896 | keys(names.getLength()); | |||
| 897 | for (sal_Int32 i = 0; i < keys.getLength(); ++i) { | |||
| 898 | keys[i] = openKey(names[i]); | |||
| 899 | OSL_ASSERT(keys[i].is())do { if (true && (!(keys[i].is()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "899" ": "), "OSL_ASSERT: %s", "keys[i].is()"); } } while (false); | |||
| 900 | } | |||
| 901 | return keys; | |||
| 902 | } | |||
| 903 | ||||
| 904 | css::uno::Sequence< rtl::OUString > Key::getKeyNames() | |||
| 905 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 906 | { | |||
| 907 | css::uno::Sequence< rtl::OUString > names(getChildren()); | |||
| 908 | rtl::OUString prefix(pathToString(path_)); | |||
| 909 | prefix += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")(&("/")[0]), ((sal_Int32)((sizeof ("/") / sizeof (("/")[0 ]))-1)), (((rtl_TextEncoding) 11))); | |||
| 910 | for (sal_Int32 i = 0; i < names.getLength(); ++i) { | |||
| 911 | names[i] = prefix + names[i]; | |||
| 912 | } | |||
| 913 | return names; | |||
| 914 | } | |||
| 915 | ||||
| 916 | sal_Bool Key::createLink(rtl::OUString const &, rtl::OUString const &) | |||
| 917 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 918 | { | |||
| 919 | throw css::registry::InvalidRegistryException( | |||
| 920 | rtl::OUString( | |||
| 921 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 922 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 923 | " createLink not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " createLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 ))), | |||
| 924 | static_cast< OWeakObject * >(this)); | |||
| 925 | } | |||
| 926 | ||||
| 927 | void Key::deleteLink(rtl::OUString const &) | |||
| 928 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 929 | { | |||
| 930 | throw css::registry::InvalidRegistryException( | |||
| 931 | rtl::OUString( | |||
| 932 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 933 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 )) | |||
| 934 | " deleteLink not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " deleteLink not supported")[0]))-1)), (((rtl_TextEncoding) 11 ))), | |||
| 935 | static_cast< OWeakObject * >(this)); | |||
| 936 | } | |||
| 937 | ||||
| 938 | rtl::OUString Key::getLinkTarget(rtl::OUString const &) | |||
| 939 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 940 | { | |||
| 941 | throw css::registry::InvalidRegistryException( | |||
| 942 | rtl::OUString( | |||
| 943 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 944 | "com.sun.star.registry.SimpleRegistry textual services key"(&("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 945 | " getLinkTarget not supported")(&("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported") / sizeof (("com.sun.star.registry.SimpleRegistry textual services key" " getLinkTarget not supported")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 946 | static_cast< OWeakObject * >(this)); | |||
| 947 | } | |||
| 948 | ||||
| 949 | rtl::OUString Key::getResolvedName(rtl::OUString const & aKeyName) | |||
| 950 | throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) | |||
| 951 | { | |||
| 952 | std::vector< rtl::OUString > path; | |||
| 953 | find(aKeyName, &path, 0, 0); | |||
| ||||
| 954 | return pathToString(path); | |||
| 955 | } | |||
| 956 | ||||
| 957 | bool Key::find( | |||
| 958 | rtl::OUString const & relative, std::vector< rtl::OUString > * path, | |||
| 959 | State * state, css::registry::RegistryValueType * type) const | |||
| 960 | { | |||
| 961 | std::vector< rtl::OUString > p(path_); | |||
| 962 | sal_Int32 i = 0; | |||
| 963 | do { | |||
| 964 | rtl::OUString seg(relative.getToken(0, '/', i)); | |||
| 965 | if (!seg.isEmpty()) { | |||
| 966 | p.push_back(seg); | |||
| 967 | } | |||
| 968 | } while (i >= 0); | |||
| 969 | if (path != 0) { | |||
| 970 | *path = p; | |||
| 971 | } | |||
| 972 | std::size_t const MAX_TRANSITIONS = 5; | |||
| 973 | struct StateInfo { | |||
| 974 | css::registry::RegistryValueType type; | |||
| 975 | std::size_t count; | |||
| 976 | struct { char const * segment; State state; } | |||
| 977 | transitions[MAX_TRANSITIONS]; | |||
| 978 | }; | |||
| 979 | static StateInfo const info[] = { | |||
| 980 | // STATE_ROOT: | |||
| 981 | { css::registry::RegistryValueType_NOT_DEFINED, 3, | |||
| 982 | { { "IMPLEMENTATIONS", STATE_IMPLEMENTATIONS }, | |||
| 983 | { "SERVICES", STATE_SERVICES }, | |||
| 984 | { "SINGLETONS", STATE_SINGLETONS } } }, | |||
| 985 | // STATE_IMPLEMENTATIONS: | |||
| 986 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 987 | { { 0, STATE_IMPLEMENTATION } } }, | |||
| 988 | // STATE_IMPLEMENTATION: | |||
| 989 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 990 | { { "UNO", STATE_UNO } } }, | |||
| 991 | // STATE_UNO: | |||
| 992 | { css::registry::RegistryValueType_NOT_DEFINED, 5, | |||
| 993 | { { "LOCATION", STATE_LOCATION }, | |||
| 994 | { "ACTIVATOR", STATE_ACTIVATOR }, | |||
| 995 | { "PREFIX", STATE_PREFIX }, | |||
| 996 | { "SERVICES", STATE_IMPLEMENTATION_SERVICES }, | |||
| 997 | { "SINGLETONS", STATE_IMPLEMENTATION_SINGLETONS } } }, | |||
| 998 | // STATE_LOCATION: | |||
| 999 | { css::registry::RegistryValueType_ASCII, 0, {} }, | |||
| 1000 | // STATE_ACTIVATOR: | |||
| 1001 | { css::registry::RegistryValueType_ASCII, 0, {} }, | |||
| 1002 | // STATE_PREFIX: | |||
| 1003 | { css::registry::RegistryValueType_ASCII, 0, {} }, | |||
| 1004 | // STATE_IMPLEMENTATION_SERVICES: | |||
| 1005 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 1006 | { { 0, STATE_IMPLEMENTATION_SERVICE } } }, | |||
| 1007 | // STATE_IMPLEMENTATION_SERVICE: | |||
| 1008 | { css::registry::RegistryValueType_NOT_DEFINED, 0, {} }, | |||
| 1009 | // STATE_IMPLEMENTATION_SINGLETONS: | |||
| 1010 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 1011 | { { 0, STATE_IMPLEMENTATION_SINGLETON } } }, | |||
| 1012 | // STATE_IMPLEMENTATION_SINGLETON: | |||
| 1013 | { css::registry::RegistryValueType_STRING, 0, {} }, | |||
| 1014 | // STATE_SERVICES: | |||
| 1015 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 1016 | { { 0, STATE_SERVICE } } }, | |||
| 1017 | // STATE_SERVICE: | |||
| 1018 | { css::registry::RegistryValueType_ASCIILIST, 0, {} }, | |||
| 1019 | // STATE_SINGLETONS: | |||
| 1020 | { css::registry::RegistryValueType_NOT_DEFINED, 1, | |||
| 1021 | { { 0, STATE_SINGLETON } } }, | |||
| 1022 | // STATE_SINGLETON: | |||
| 1023 | { css::registry::RegistryValueType_STRING, 1, | |||
| 1024 | { { "REGISTERED_BY", STATE_REGISTEREDBY } } }, | |||
| 1025 | // STATE_REGISTEREDBY: | |||
| 1026 | { css::registry::RegistryValueType_ASCIILIST, 0, {} } }; | |||
| 1027 | State s = STATE_ROOT; | |||
| 1028 | for (std::vector< rtl::OUString >::iterator j(p.begin()); j != p.end(); ++j) | |||
| 1029 | { | |||
| 1030 | bool found = false; | |||
| 1031 | for (std::size_t k = 0; k < info[s].count; ++k) { | |||
| 1032 | if (info[s].transitions[k].segment == 0) { | |||
| 1033 | switch (info[s].transitions[k].state) { | |||
| 1034 | case STATE_IMPLEMENTATION: | |||
| 1035 | found = data_->implementations.find(*j) != | |||
| 1036 | data_->implementations.end(); | |||
| 1037 | break; | |||
| 1038 | case STATE_IMPLEMENTATION_SERVICE: | |||
| 1039 | case STATE_IMPLEMENTATION_SINGLETON: | |||
| 1040 | found = true; //TODO | |||
| 1041 | break; | |||
| 1042 | case STATE_SERVICE: | |||
| 1043 | found = data_->services.find(*j) != data_->services.end(); | |||
| ||||
| 1044 | break; | |||
| 1045 | case STATE_SINGLETON: | |||
| 1046 | found = data_->singletons.find(*j) != | |||
| 1047 | data_->singletons.end(); | |||
| 1048 | break; | |||
| 1049 | default: | |||
| 1050 | std::abort(); // this cannot happen | |||
| 1051 | } | |||
| 1052 | } else { | |||
| 1053 | found = j->equalsAscii(info[s].transitions[k].segment); | |||
| 1054 | } | |||
| 1055 | if (found) { | |||
| 1056 | s = info[s].transitions[k].state; | |||
| 1057 | break; | |||
| 1058 | } | |||
| 1059 | } | |||
| 1060 | if (!found) { | |||
| 1061 | return false; | |||
| 1062 | } | |||
| 1063 | } | |||
| 1064 | if (state != 0) { | |||
| 1065 | *state = s; | |||
| 1066 | } | |||
| 1067 | if (type != 0) { | |||
| 1068 | *type = info[s].type; | |||
| 1069 | } | |||
| 1070 | return true; | |||
| 1071 | } | |||
| 1072 | ||||
| 1073 | css::uno::Sequence< rtl::OUString > Key::getChildren() { | |||
| 1074 | State state = STATE_ROOT; | |||
| 1075 | OSL_VERIFY(find(rtl::OUString(), 0, &state, 0))do { if (!(find(rtl::OUString(), 0, &state, 0))) do { if ( true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN ), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/simpleregistry/textualservices.cxx" ":" "1075" ": "), "OSL_ASSERT: %s", "0"); } } while (false); } while (0); | |||
| 1076 | switch (state) { | |||
| 1077 | default: | |||
| 1078 | std::abort(); // this cannot happen | |||
| 1079 | // pseudo-fall-through to avoid warnings on MSC | |||
| 1080 | case STATE_ROOT: | |||
| 1081 | { | |||
| 1082 | css::uno::Sequence< rtl::OUString > seq(3); | |||
| 1083 | seq[0] = rtl::OUString( | |||
| 1084 | RTL_CONSTASCII_USTRINGPARAM("IMPLEMENTATIONS")(&("IMPLEMENTATIONS")[0]), ((sal_Int32)((sizeof ("IMPLEMENTATIONS" ) / sizeof (("IMPLEMENTATIONS")[0]))-1)), (((rtl_TextEncoding ) 11))); | |||
| 1085 | seq[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SERVICES")(&("SERVICES")[0]), ((sal_Int32)((sizeof ("SERVICES") / sizeof (("SERVICES")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1086 | seq[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SINGLETONS")(&("SINGLETONS")[0]), ((sal_Int32)((sizeof ("SINGLETONS") / sizeof (("SINGLETONS")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1087 | return seq; | |||
| 1088 | } | |||
| 1089 | case STATE_IMPLEMENTATIONS: | |||
| 1090 | { | |||
| 1091 | if (data_->implementations.size() > SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) { | |||
| 1092 | throw css::registry::InvalidValueException( | |||
| 1093 | rtl::OUString( | |||
| 1094 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1095 | "com.sun.star.registry.SimpleRegistry textual"(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1096 | " services key openKeys: too large")(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 1097 | static_cast< OWeakObject * >(this)); | |||
| 1098 | } | |||
| 1099 | css::uno::Sequence< rtl::OUString > seq( | |||
| 1100 | static_cast< sal_Int32 >(data_->implementations.size())); | |||
| 1101 | sal_Int32 i = 0; | |||
| 1102 | for (Implementations::iterator j(data_->implementations.begin()); | |||
| 1103 | j != data_->implementations.end(); ++j) | |||
| 1104 | { | |||
| 1105 | seq[i++] = j->first; | |||
| 1106 | } | |||
| 1107 | return seq; | |||
| 1108 | } | |||
| 1109 | case STATE_UNO: | |||
| 1110 | { | |||
| 1111 | css::uno::Sequence< rtl::OUString > seq(5); | |||
| 1112 | seq[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOCATION")(&("LOCATION")[0]), ((sal_Int32)((sizeof ("LOCATION") / sizeof (("LOCATION")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1113 | seq[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ACTIVATOR")(&("ACTIVATOR")[0]), ((sal_Int32)((sizeof ("ACTIVATOR") / sizeof (("ACTIVATOR")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1114 | seq[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFIX")(&("PREFIX")[0]), ((sal_Int32)((sizeof ("PREFIX") / sizeof (("PREFIX")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1115 | seq[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SERVICES")(&("SERVICES")[0]), ((sal_Int32)((sizeof ("SERVICES") / sizeof (("SERVICES")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1116 | seq[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SINGLETONS")(&("SINGLETONS")[0]), ((sal_Int32)((sizeof ("SINGLETONS") / sizeof (("SINGLETONS")[0]))-1)), (((rtl_TextEncoding) 11))); | |||
| 1117 | return seq; | |||
| 1118 | } | |||
| 1119 | case STATE_LOCATION: | |||
| 1120 | case STATE_ACTIVATOR: | |||
| 1121 | case STATE_PREFIX: | |||
| 1122 | case STATE_IMPLEMENTATION_SERVICE: | |||
| 1123 | case STATE_IMPLEMENTATION_SINGLETON: | |||
| 1124 | case STATE_SERVICE: | |||
| 1125 | case STATE_REGISTEREDBY: | |||
| 1126 | return css::uno::Sequence< rtl::OUString >(); | |||
| 1127 | case STATE_IMPLEMENTATION_SERVICES: | |||
| 1128 | { | |||
| 1129 | if (data_->implementations[path_[1]].services.size() > | |||
| 1130 | SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) | |||
| 1131 | { | |||
| 1132 | throw css::registry::InvalidValueException( | |||
| 1133 | rtl::OUString( | |||
| 1134 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1135 | "com.sun.star.registry.SimpleRegistry textual"(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1136 | " services key openKeys: too large")(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 1137 | static_cast< OWeakObject * >(this)); | |||
| 1138 | } | |||
| 1139 | css::uno::Sequence< rtl::OUString > seq( | |||
| 1140 | static_cast< sal_Int32 >( | |||
| 1141 | data_->implementations[path_[1]].services.size())); | |||
| 1142 | sal_Int32 i = 0; | |||
| 1143 | for (std::vector< rtl::OUString >::iterator j( | |||
| 1144 | data_->implementations[path_[1]].services.begin()); | |||
| 1145 | j != data_->implementations[path_[1]].services.end(); ++j) | |||
| 1146 | { | |||
| 1147 | seq[i++] = *j; | |||
| 1148 | } | |||
| 1149 | return seq; | |||
| 1150 | } | |||
| 1151 | case STATE_IMPLEMENTATION_SINGLETONS: | |||
| 1152 | { | |||
| 1153 | if (data_->implementations[path_[1]].singletons.size() > | |||
| 1154 | SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) | |||
| 1155 | { | |||
| 1156 | throw css::registry::InvalidValueException( | |||
| 1157 | rtl::OUString( | |||
| 1158 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1159 | "com.sun.star.registry.SimpleRegistry textual"(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1160 | " services key openKeys: too large")(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 1161 | static_cast< OWeakObject * >(this)); | |||
| 1162 | } | |||
| 1163 | css::uno::Sequence< rtl::OUString > seq( | |||
| 1164 | static_cast< sal_Int32 >( | |||
| 1165 | data_->implementations[path_[1]].singletons.size())); | |||
| 1166 | sal_Int32 i = 0; | |||
| 1167 | for (std::vector< rtl::OUString >::iterator j( | |||
| 1168 | data_->implementations[path_[1]].singletons.begin()); | |||
| 1169 | j != data_->implementations[path_[1]].singletons.end(); ++j) | |||
| 1170 | { | |||
| 1171 | seq[i++] = *j; | |||
| 1172 | } | |||
| 1173 | return seq; | |||
| 1174 | } | |||
| 1175 | case STATE_SERVICES: | |||
| 1176 | { | |||
| 1177 | if (data_->services.size() > SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) { | |||
| 1178 | throw css::registry::InvalidValueException( | |||
| 1179 | rtl::OUString( | |||
| 1180 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1181 | "com.sun.star.registry.SimpleRegistry textual"(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1182 | " services key openKeys: too large")(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 1183 | static_cast< OWeakObject * >(this)); | |||
| 1184 | } | |||
| 1185 | css::uno::Sequence< rtl::OUString > seq( | |||
| 1186 | static_cast< sal_Int32 >(data_->services.size())); | |||
| 1187 | sal_Int32 i = 0; | |||
| 1188 | for (ImplementationMap::iterator j(data_->services.begin()); | |||
| 1189 | j != data_->services.end(); ++j) | |||
| 1190 | { | |||
| 1191 | seq[i++] = j->first; | |||
| 1192 | } | |||
| 1193 | return seq; | |||
| 1194 | } | |||
| 1195 | case STATE_SINGLETONS: | |||
| 1196 | { | |||
| 1197 | if (data_->singletons.size() > SAL_MAX_INT32((sal_Int32) 0x7FFFFFFF)) { | |||
| 1198 | throw css::registry::InvalidValueException( | |||
| 1199 | rtl::OUString( | |||
| 1200 | RTL_CONSTASCII_USTRINGPARAM((&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1201 | "com.sun.star.registry.SimpleRegistry textual"(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11)) | |||
| 1202 | " services key openKeys: too large")(&("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large" )[0]), ((sal_Int32)((sizeof ("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large") / sizeof (("com.sun.star.registry.SimpleRegistry textual" " services key openKeys: too large")[0]))-1)), (((rtl_TextEncoding ) 11))), | |||
| 1203 | static_cast< OWeakObject * >(this)); | |||
| 1204 | } | |||
| 1205 | css::uno::Sequence< rtl::OUString > seq( | |||
| 1206 | static_cast< sal_Int32 >(data_->singletons.size())); | |||
| 1207 | sal_Int32 i = 0; | |||
| 1208 | for (ImplementationMap::iterator j(data_->singletons.begin()); | |||
| 1209 | j != data_->singletons.end(); ++j) | |||
| 1210 | { | |||
| 1211 | seq[i++] = j->first; | |||
| 1212 | } | |||
| 1213 | return seq; | |||
| 1214 | } | |||
| 1215 | case STATE_SINGLETON: | |||
| 1216 | { | |||
| 1217 | css::uno::Sequence< rtl::OUString > seq(1); | |||
| 1218 | seq[0] = rtl::OUString( | |||
| 1219 | RTL_CONSTASCII_USTRINGPARAM("REGISTERED_BY")(&("REGISTERED_BY")[0]), ((sal_Int32)((sizeof ("REGISTERED_BY" ) / sizeof (("REGISTERED_BY")[0]))-1)), (((rtl_TextEncoding) 11 ))); | |||
| 1220 | return seq; | |||
| 1221 | } | |||
| 1222 | } | |||
| 1223 | } | |||
| 1224 | ||||
| 1225 | } | |||
| 1226 | ||||
| 1227 | TextualServices::TextualServices(rtl::OUString const & uri): | |||
| 1228 | uri_(uri), data_(new Data) | |||
| 1229 | { | |||
| 1230 | try { | |||
| 1231 | Parser(uri, data_); | |||
| 1232 | } catch (css::container::NoSuchElementException &) { | |||
| 1233 | throw css::registry::InvalidRegistryException( | |||
| 1234 | (uri + | |||
| 1235 | rtl::OUString( | |||
| 1236 | RTL_CONSTASCII_USTRINGPARAM(": no such file")(&(": no such file")[0]), ((sal_Int32)((sizeof (": no such file" ) / sizeof ((": no such file")[0]))-1)), (((rtl_TextEncoding) 11)))), | |||
| 1237 | css::uno::Reference< css::uno::XInterface >()); | |||
| 1238 | } | |||
| 1239 | } | |||
| 1240 | ||||
| 1241 | TextualServices::~TextualServices() {} | |||
| 1242 | ||||
| 1243 | css::uno::Reference< css::registry::XRegistryKey > TextualServices::getRootKey() | |||
| 1244 | { | |||
| 1245 | return new Key(data_, std::vector< rtl::OUString >()); | |||
| 1246 | } | |||
| 1247 | ||||
| 1248 | } } | |||
| 1249 | ||||
| 1250 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |