[Libreoffice-commits] core.git: framework/inc framework/source

Stephan Bergmann sbergman at redhat.com
Tue Apr 19 06:50:01 UTC 2016


 framework/inc/acceleratorconst.h                        |   14 -----------
 framework/source/xml/acceleratorconfigurationwriter.cxx |   19 +++++++++-------
 2 files changed, 11 insertions(+), 22 deletions(-)

New commits:
commit 0d7eb3ed98ebb21bc77f5cbe4997acb6988ddd6e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 19 08:49:06 2016 +0200

    Elide macros used once
    
    Change-Id: I5d5c916c966c9e9f2c77c9655f3e8d13a7032117

diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h
index 47949bf..de798bf 100644
--- a/framework/inc/acceleratorconst.h
+++ b/framework/inc/acceleratorconst.h
@@ -30,20 +30,6 @@ namespace framework{
 #define AL_ELEMENT_ACCELERATORLIST      "accel:acceleratorlist"
 #define AL_ELEMENT_ITEM                 "accel:item"
 
-#define AL_XMLNS_ACCEL                  "xmlns:accel"
-#define AL_XMLNS_XLINK                  "xmlns:xlink"
-
-#define AL_ATTRIBUTE_URL                "xlink:href"
-#define AL_ATTRIBUTE_KEYCODE            "accel:code"
-#define AL_ATTRIBUTE_MOD_SHIFT          "accel:shift"
-#define AL_ATTRIBUTE_MOD_MOD1           "accel:mod1"
-#define AL_ATTRIBUTE_MOD_MOD2           "accel:mod2"
-#define AL_ATTRIBUTE_MOD_MOD3           "accel:mod3"
-
-// same items with full qualified name space
-#define NS_XMLNS_ACCEL                  "http://openoffice.org/2001/accel"
-#define NS_XMLNS_XLINK                  "http://www.w3.org/1999/xlink"
-
 } // namespace framework
 
 #endif // INCLUDED_FRAMEWORK_INC_ACCELERATORCONST_H
diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx
index 48a45c1..f5e8463 100644
--- a/framework/source/xml/acceleratorconfigurationwriter.cxx
+++ b/framework/source/xml/acceleratorconfigurationwriter.cxx
@@ -54,8 +54,11 @@ void AcceleratorConfigurationWriter::flush()
     ::comphelper::AttributeList* pAttribs = new ::comphelper::AttributeList;
     css::uno::Reference< css::xml::sax::XAttributeList > xAttribs(static_cast< css::xml::sax::XAttributeList* >(pAttribs), css::uno::UNO_QUERY);
 
-    pAttribs->AddAttribute(AL_XMLNS_ACCEL, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_ACCEL);
-    pAttribs->AddAttribute(AL_XMLNS_XLINK, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_XLINK);
+    pAttribs->AddAttribute(
+        "xmlns:accel", ATTRIBUTE_TYPE_CDATA,
+        "http://openoffice.org/2001/accel");
+    pAttribs->AddAttribute(
+        "xmlns:xlink", ATTRIBUTE_TYPE_CDATA, "http://www.w3.org/1999/xlink");
 
     // generate xml
     xExtendedCFG->startDocument();
@@ -102,20 +105,20 @@ void AcceleratorConfigurationWriter::impl_ts_writeKeyCommandPair(const css::awt:
     OUString sKey = KeyMapping::get().mapCodeToIdentifier(aKey.KeyCode);
     // TODO check if key is empty!
 
-    pAttribs->AddAttribute(AL_ATTRIBUTE_KEYCODE, ATTRIBUTE_TYPE_CDATA, sKey    );
-    pAttribs->AddAttribute(AL_ATTRIBUTE_URL    , ATTRIBUTE_TYPE_CDATA, sCommand);
+    pAttribs->AddAttribute("accel:code", ATTRIBUTE_TYPE_CDATA, sKey    );
+    pAttribs->AddAttribute("xlink:href", ATTRIBUTE_TYPE_CDATA, sCommand);
 
     if ((aKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT)
-        pAttribs->AddAttribute(AL_ATTRIBUTE_MOD_SHIFT, ATTRIBUTE_TYPE_CDATA, "true");
+        pAttribs->AddAttribute("accel:shift", ATTRIBUTE_TYPE_CDATA, "true");
 
     if ((aKey.Modifiers & css::awt::KeyModifier::MOD1) == css::awt::KeyModifier::MOD1)
-        pAttribs->AddAttribute(AL_ATTRIBUTE_MOD_MOD1, ATTRIBUTE_TYPE_CDATA, "true");
+        pAttribs->AddAttribute("accel:mod1", ATTRIBUTE_TYPE_CDATA, "true");
 
     if ((aKey.Modifiers & css::awt::KeyModifier::MOD2) == css::awt::KeyModifier::MOD2)
-        pAttribs->AddAttribute(AL_ATTRIBUTE_MOD_MOD2, ATTRIBUTE_TYPE_CDATA, "true");
+        pAttribs->AddAttribute("accel:mod2", ATTRIBUTE_TYPE_CDATA, "true");
 
     if ((aKey.Modifiers & css::awt::KeyModifier::MOD3) == css::awt::KeyModifier::MOD3)
-        pAttribs->AddAttribute(AL_ATTRIBUTE_MOD_MOD3, ATTRIBUTE_TYPE_CDATA, "true");
+        pAttribs->AddAttribute("accel:mod3", ATTRIBUTE_TYPE_CDATA, "true");
 
     xConfig->ignorableWhitespace(OUString());
     xConfig->startElement(AL_ELEMENT_ITEM, xAttribs);


More information about the Libreoffice-commits mailing list