diff options
-rw-r--r-- | configmgr/source/childaccess.cxx | 18 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 12 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 2 |
3 files changed, 21 insertions, 11 deletions
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index c20fa49fb18c..d387f351de30 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -282,8 +282,8 @@ css::uno::Any ChildAccess::asValue() { if (!Components::allLocales(locale)) { // Find best match using an adaption of RFC 4647 lookup matching // rules, removing "-" or "_" delimited segments from the end; - // defaults are the empty string locale, the "en-US" locale, the - // "en" locale, the first child (if any), or a nil value (even + // defaults are the "en-US" locale, the "en" locale, the empty + // string locale, the first child (if any), or a nil value (even // though it may be illegal for the given property), in that // order: rtl::Reference< ChildAccess > child; @@ -296,6 +296,9 @@ css::uno::Any ChildAccess::asValue() { while (i > 0 && locale[i] != '-' && locale[i] != '_') { --i; } + if (i == 0) { + break; + } locale = locale.copy(0, i); } if (!child.is()) { @@ -305,10 +308,13 @@ css::uno::Any ChildAccess::asValue() { child = getChild( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"))); if (!child.is()) { - std::vector< rtl::Reference< ChildAccess > > all( - getAllChildren()); - if (!all.empty()) { - child = all.front(); + child = getChild(rtl::OUString()); + if (!child.is()) { + std::vector< rtl::Reference< ChildAccess > > + all(getAllChildren()); + if (!all.empty()) { + child = all.front(); + } } } } diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 0d57e566ef8a..73683884e2bd 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -248,9 +248,12 @@ namespace if(nPushFlags) { OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)"); - PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back()); - pNew->setPushFlags(nPushFlags); - maPropertyHolders.push_back(pNew); + if ( !maPropertyHolders.empty() ) + { + PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back()); + pNew->setPushFlags(nPushFlags); + maPropertyHolders.push_back(pNew); + } } } @@ -354,8 +357,9 @@ namespace PropertyHolder& Current() { + static PropertyHolder aDummy; OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: CURRENT with no property holders (!)"); - return *maPropertyHolders.back(); + return maPropertyHolders.empty() ? aDummy : *maPropertyHolders.back(); } ~PropertyHolders() diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index ae977b2ed0d7..f2481e79eb22 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -701,7 +701,7 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( bRunNext = true; } } - else if ( cChar == '/' ) + else if ( cChar == '/' && nEndPos > 1 && rTxt.Len() > (nEndPos - 1) ) { // Remove the hardspace right before to avoid formatting URLs sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 ); |