[Libreoffice-commits] .: 2 commits - configmgr/source vcl/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Fri Dec 16 23:56:16 PST 2011


 configmgr/source/access.cxx                |   16 ++++++++--------
 configmgr/source/childaccess.cxx           |    6 +++---
 configmgr/source/components.cxx            |    2 +-
 configmgr/source/configurationprovider.cxx |   22 +++++++++++-----------
 configmgr/source/data.cxx                  |   12 ++++++------
 configmgr/source/propertynode.cxx          |    2 +-
 configmgr/source/valueparser.cxx           |    6 +++---
 configmgr/source/writemodfile.cxx          |    6 +++---
 configmgr/source/xcdparser.cxx             |    4 ++--
 configmgr/source/xcuparser.cxx             |    6 +++---
 vcl/source/window/printdlg.cxx             |    3 +++
 11 files changed, 44 insertions(+), 41 deletions(-)

New commits:
commit c4ccdda15a66ae6d8751da7401f5ea4f46df0c04
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sat Dec 17 11:53:26 2011 +0400

    fdo#34641: set initial focus to "Number of copies"

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6119555..b1c9b4b 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -902,6 +902,9 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
     // setup dependencies
     checkControlDependencies();
 
+    // set initial focus to "Number of copies"
+    maJobPage.maCopyCountField.GrabFocus();
+    maJobPage.maCopyCountField.SetSelection( Selection(0, 0xFFFF) );
 }
 
 PrintDialog::~PrintDialog()
commit 4a0ab53cf44be11053a095470ad8cb426487dbc6
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Wed Dec 14 10:59:15 2011 -0200

    Fix for fdo43460 Part VIII getLength() to isEmpty()
    
    Part VIII
    Module
    comfigmgr

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index b6617b4..694e081 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -615,7 +615,7 @@ rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
         path.append(root->getAbsolutePathRepresentation());
     }
     rtl::OUString rel(getRelativePathRepresentation());
-    if (path.getLength() != 0 && rel.getLength() != 0) {
+    if (path.getLength() != 0 && !rel.isEmpty()) {
         path.append(sal_Unicode('/'));
     }
     path.append(rel);
@@ -631,7 +631,7 @@ rtl::OUString Access::composeHierarchicalName(
     assert(thisIs(IS_ANY));
     osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
-    if (aRelativeName.getLength() == 0 || aRelativeName[0] == '/') {
+    if (aRelativeName.isEmpty() || aRelativeName[0] == '/') {
         throw css::lang::IllegalArgumentException(
             rtl::OUString(
                 RTL_CONSTASCII_USTRINGPARAM(
@@ -671,7 +671,7 @@ void Access::setName(rtl::OUString const & aName)
                 rtl::Reference< Access > parent(getParentAccess());
                 if (parent.is()) {
                     rtl::Reference< Node > node(getNode());
-                    if (node->getTemplateName().getLength() != 0) {
+                    if (! node->getTemplateName().isEmpty()) {
                         rtl::Reference< ChildAccess > other(
                             parent->getChild(aName));
                         if (other.get() == this) {
@@ -1817,7 +1817,7 @@ void Access::initBroadcasterAndChanges(
             case Node::KIND_GROUP:
             case Node::KIND_SET:
                 if (i->second.children.empty()) {
-                    if (child->getNode()->getTemplateName().getLength() != 0) {
+                    if (!child->getNode()->getTemplateName().isEmpty()) {
                         for (ContainerListeners::iterator j(
                                  containerListeners_.begin());
                              j != containerListeners_.end(); ++j)
@@ -2054,7 +2054,7 @@ rtl::Reference< ChildAccess > Access::getUnmodifiedChild(
 rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) {
     sal_Int32 i = 0;
     // For backwards compatibility, allow absolute paths where meaningful:
-    if (path.getLength() != 0 && path[0] == '/') {
+    if (!path.isEmpty() && path[0] == '/') {
         ++i;
         if (!getRootAccess().is()) {
             return rtl::Reference< ChildAccess >();
@@ -2101,13 +2101,13 @@ rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) {
             switch (p->kind()) {
             case Node::KIND_LOCALIZED_PROPERTY:
                 if (!Components::allLocales(getRootAccess()->getLocale()) ||
-                    templateName.getLength() != 0)
+                    !templateName.isEmpty())
                 {
                     return rtl::Reference< ChildAccess >();
                 }
                 break;
             case Node::KIND_SET:
-                if (templateName.getLength() != 0 &&
+                if (!templateName.isEmpty() &&
                     !dynamic_cast< SetNode * >(p.get())->isValidTemplate(
                         templateName))
                 {
@@ -2211,7 +2211,7 @@ void Access::checkFinalized() {
 }
 
 void Access::checkKnownProperty(rtl::OUString const & descriptor) {
-    if (descriptor.getLength() == 0) {
+    if (descriptor.isEmpty()) {
         return;
     }
     rtl::Reference< ChildAccess > child(getChild(descriptor));
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index a9c41d2..180df7c 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -201,7 +201,7 @@ void ChildAccess::bind(
     rtl::Reference< Access > const & parent, rtl::OUString const & name)
     throw ()
 {
-    assert(!parent_.is() && root.is() && parent.is() && name.getLength() != 0);
+    assert(!parent_.is() && root.is() && parent.is() && !name.isEmpty());
     root_ = root;
     parent_ = parent;
     name_ = name;
@@ -272,7 +272,7 @@ namespace
 {
     rtl::OUString lcl_StripSegment(const rtl::OUString &rLocale)
     {
-        sal_Int32 i = rLocale.getLength() ? rLocale.getLength() - 1 : 0;
+        sal_Int32 i = !rLocale.isEmpty() ? rLocale.getLength() - 1 : 0;
         while (i > 0 && rLocale[i] != '-' && rLocale[i] != '_')
             --i;
         return rLocale.copy(0, i);
@@ -301,7 +301,7 @@ css::uno::Any ChildAccess::asValue() {
                     if (child.is())
                         break;
                     rtl::OUString sTmpLocale = lcl_StripSegment(sLocale);
-                    if (!sTmpLocale.getLength())
+                    if (sTmpLocale.isEmpty())
                         break;
                     sLocale = sTmpLocale;
                 }
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 77f8c01..a44f07c 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -710,7 +710,7 @@ void Components::parseFileList(
 {
     for (sal_Int32 i = 0;;) {
         rtl::OUString url(urls.getToken(0, ' ', i));
-        if (url.getLength() != 0) {
+        if (!url.isEmpty()) {
             ini.expandMacrosFrom(url); //TODO: detect failure
             Additions * adds = 0;
             if (recordAdditions) {
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index 952db7a..5a7ed78 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -205,7 +205,7 @@ Service::createInstanceWithArguments(
         } else if (Arguments.getLength() == 1 && (Arguments[i] >>= nodepath)) {
             // For backwards compatibility, allow a single string argument that
             // denotes nodepath.
-            if (nodepath.getLength() == 0) {
+            if (nodepath.isEmpty()) {
                 badNodePath();
             }
             break;
@@ -222,16 +222,16 @@ Service::createInstanceWithArguments(
         if (name.equalsIgnoreAsciiCaseAsciiL(
                 RTL_CONSTASCII_STRINGPARAM("nodepath")))
         {
-            if (nodepath.getLength() != 0 || !(value >>= nodepath) ||
-                nodepath.getLength() == 0)
+            if (!nodepath.isEmpty() || !(value >>= nodepath) ||
+                nodepath.isEmpty())
             {
                 badNodePath();
             }
         } else if (name.equalsIgnoreAsciiCaseAsciiL(
                        RTL_CONSTASCII_STRINGPARAM("locale")))
         {
-            if (locale.getLength() != 0 || !(value >>= locale) ||
-                locale.getLength() == 0)
+            if (!locale.isEmpty() || !(value >>= locale) ||
+                locale.isEmpty())
             {
                 throw css::uno::Exception(
                     rtl::OUString(
@@ -243,7 +243,7 @@ Service::createInstanceWithArguments(
             }
         }
     }
-    if (nodepath.getLength() == 0) {
+    if (nodepath.isEmpty()) {
         badNodePath();
     }
     // For backwards compatibility, allow a nodepath that misses the leading
@@ -251,10 +251,10 @@ Service::createInstanceWithArguments(
     if (nodepath[0] != '/') {
         nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath;
     }
-    if (locale.getLength() == 0) {
+    if (locale.isEmpty()) {
         //TODO: should the Access use the dynamically changing locale_ instead?
         locale = locale_;
-        if (locale.getLength() == 0) {
+        if (locale.isEmpty()) {
             locale = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"));
         }
     }
@@ -367,7 +367,7 @@ css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) {
     css::lang::Locale loc;
     if (locale_.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"))) {
         loc.Language = locale_;
-    } else if (locale_.getLength() != 0) {
+    } else if (! locale_.isEmpty()) {
         try {
             comphelper::Locale l(locale_);
             loc.Language = l.getLanguage();
@@ -487,8 +487,8 @@ Factory::createInstanceWithArgumentsAndContext(
             if (name.equalsIgnoreAsciiCaseAsciiL(
                     RTL_CONSTASCII_STRINGPARAM("locale")))
             {
-                if (locale.getLength() != 0 || !(value >>= locale) ||
-                    locale.getLength() == 0)
+                if (!locale.isEmpty() || !(value >>= locale) ||
+                    locale.isEmpty())
                 {
                     throw css::uno::Exception(
                         rtl::OUString(
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index df7ce60..963d353 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -99,7 +99,7 @@ bool decode(
 rtl::OUString Data::createSegment(
     rtl::OUString const & templateName, rtl::OUString const & name)
 {
-    if (templateName.getLength() == 0) {
+    if (templateName.isEmpty()) {
         return name;
     }
     rtl::OUStringBuffer buf(templateName);
@@ -215,7 +215,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
     rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
     const
 {
-    if (pathRepresentation.getLength() == 0 || pathRepresentation[0] != '/') {
+    if (pathRepresentation.isEmpty() || pathRepresentation[0] != '/') {
         throw css::uno::RuntimeException(
             (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
              pathRepresentation),
@@ -295,7 +295,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
         if (setElement) {
             switch (parent->kind()) {
             case Node::KIND_LOCALIZED_PROPERTY:
-                if (templateName.getLength() != 0) {
+                if (!templateName.isEmpty()) {
                     throw css::uno::RuntimeException(
                         (rtl::OUString(
                             RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
@@ -304,7 +304,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
                 }
                 break;
             case Node::KIND_SET:
-                if (templateName.getLength() != 0 &&
+                if (!templateName.isEmpty() &&
                     !dynamic_cast< SetNode * >(parent.get())->isValidTemplate(
                         templateName))
                 {
@@ -321,8 +321,8 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
                      pathRepresentation),
                     css::uno::Reference< css::uno::XInterface >());
             }
-            if (templateName.getLength() != 0 && p != 0) {
-                assert(p->getTemplateName().getLength() != 0);
+            if (!templateName.isEmpty() && p != 0) {
+                assert(!p->getTemplateName().isEmpty());
                 if (!equalTemplateNames(templateName, p->getTemplateName())) {
                     throw css::uno::RuntimeException(
                         (rtl::OUString(
diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx
index 5aa86db..ea95274 100644
--- a/configmgr/source/propertynode.cxx
+++ b/configmgr/source/propertynode.cxx
@@ -69,7 +69,7 @@ bool PropertyNode::isNillable() const {
 }
 
 css::uno::Any PropertyNode::getValue(Components & components) {
-    if (externalDescriptor_.getLength() != 0) {
+    if (!externalDescriptor_.isEmpty()) {
         css::beans::Optional< css::uno::Any > val(
             components.getExternalValue(externalDescriptor_));
         if (val.IsPresent) {
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index ab6104d..005cdae 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -194,7 +194,7 @@ template< typename T > css::uno::Any parseListValue(
 {
     comphelper::SequenceAsVector< T > seq;
     xmlreader::Span sep;
-    if (separator.getLength() == 0) {
+    if (separator.isEmpty()) {
         sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" "));
     } else {
         sep = xmlreader::Span(separator.getStr(), separator.getLength());
@@ -285,7 +285,7 @@ xmlreader::XmlReader::Text ValueParser::getTextMode() const {
         case STATE_IT:
             return
                 (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
-                 separator_.getLength() != 0)
+                 !separator_.isEmpty())
                 ? xmlreader::XmlReader::TEXT_RAW
                 : xmlreader::XmlReader::TEXT_NORMALIZED;
         default:
@@ -305,7 +305,7 @@ bool ValueParser::startElement(
     case STATE_TEXT:
         if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
-            isListType(type_) && separator_.getLength() == 0)
+            isListType(type_) && separator_.isEmpty())
         {
             pad_.clear();
                 // before first <it>, characters are not ignored; assume they
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index 9662342..8683302 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -405,7 +405,7 @@ void writeNode(
     case Node::KIND_LOCALIZED_VALUE:
         {
             writeData(handle, RTL_CONSTASCII_STRINGPARAM("<value"));
-            if (name.getLength() != 0) {
+            if (!name.isEmpty()) {
                 writeData(handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
                 writeAttributeValue(handle, name);
                 writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
@@ -438,7 +438,7 @@ void writeNode(
     case Node::KIND_SET:
         writeData(handle, RTL_CONSTASCII_STRINGPARAM("<node oor:name=\""));
         writeAttributeValue(handle, name);
-        if (node->getTemplateName().getLength() != 0) { // set member
+        if (!node->getTemplateName().isEmpty()) { // set member
             writeData(
                 handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"replace"));
         }
@@ -477,7 +477,7 @@ void writeModifications(
             switch (parent->kind()) {
             case Node::KIND_LOCALIZED_PROPERTY:
                 writeData(handle, RTL_CONSTASCII_STRINGPARAM("<value"));
-                if (nodeName.getLength() != 0) {
+                if (!nodeName.isEmpty()) {
                     writeData(
                         handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
                     writeAttributeValue(handle, nodeName);
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
index 84c12bd..e5c0921 100644
--- a/configmgr/source/xcdparser.cxx
+++ b/configmgr/source/xcdparser.cxx
@@ -86,7 +86,7 @@ bool XcdParser::startElement(
         if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
             name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
         {
-            if (dependency_.getLength() == 0) {
+            if (dependency_.isEmpty()) {
                 xmlreader::Span attrFile;
                 for (;;) {
                     int attrNsId;
@@ -110,7 +110,7 @@ bool XcdParser::startElement(
                         css::uno::Reference< css::uno::XInterface >());
                 }
                 dependency_ = attrFile.convertFromUtf8();
-                if (dependency_.getLength() == 0) {
+                if (dependency_.isEmpty()) {
                     throw css::uno::RuntimeException(
                         (rtl::OUString(
                             RTL_CONSTASCII_USTRINGPARAM(
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index db599c0..6ee5c82 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -493,7 +493,7 @@ void XcuParser::handlePropValue(
             attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
         {
             external = reader.getAttributeValue(true).convertFromUtf8();
-            if (external.getLength() == 0) {
+            if (external.isEmpty()) {
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM(
@@ -512,7 +512,7 @@ void XcuParser::handlePropValue(
                  reader.getUrl()),
                 css::uno::Reference< css::uno::XInterface >());
         }
-        if (external.getLength() != 0) {
+        if (!external.isEmpty()) {
             throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM(
@@ -522,7 +522,7 @@ void XcuParser::handlePropValue(
         }
         prop->setValue(valueParser_.getLayer(), css::uno::Any());
         state_.push(State(false));
-    } else if (external.getLength() == 0) {
+    } else if (external.isEmpty()) {
         valueParser_.separator_ = separator;
         valueParser_.start(prop);
     } else {


More information about the Libreoffice-commits mailing list