diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-19 08:49:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-19 08:49:40 +0200 |
commit | 0d7eb3ed98ebb21bc77f5cbe4997acb6988ddd6e (patch) | |
tree | 2657833fa53d50195649691d6587d7d05ecc034d /framework | |
parent | c977def4a1f38662db96383eb3dc7047a1e772dc (diff) |
Elide macros used once
Change-Id: I5d5c916c966c9e9f2c77c9655f3e8d13a7032117
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/acceleratorconst.h | 14 | ||||
-rw-r--r-- | framework/source/xml/acceleratorconfigurationwriter.cxx | 19 |
2 files changed, 11 insertions, 22 deletions
diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h index 47949bf17c8e..de798bf8a3ca 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 48a45c120c77..f5e84631d652 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); |