summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/builder.hxx15
-rw-r--r--include/vcl/builderbase.hxx18
-rw-r--r--vcl/source/window/builder.cxx11
3 files changed, 26 insertions, 18 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index e378601656cb..5c4fd558b5d2 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -139,17 +139,6 @@ private:
};
std::vector<MenuAndId> m_aMenus;
- struct StringPair
- {
- OUString m_sID;
- OUString m_sValue;
- StringPair(OUString sId, OUString sValue)
- : m_sID(std::move(sId))
- , m_sValue(std::move(sValue))
- {
- }
- };
-
typedef StringPair RadioButtonGroupMap;
struct ButtonImageWidgetMap
@@ -168,7 +157,6 @@ private:
typedef StringPair TextBufferMap;
typedef StringPair WidgetAdjustmentMap;
typedef StringPair ButtonMenuMap;
- typedef StringPair MnemonicWidgetMap;
struct ComboBoxModelMap
{
@@ -223,8 +211,6 @@ private:
std::map<VclPtr<vcl::Window>, stringmap> m_aAtkInfo;
- std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps;
-
std::vector< VclPtr<VclExpander> > m_aExpanderWidgets;
std::vector< VclPtr<MessageDialog> > m_aMessageDialogs;
@@ -285,7 +271,6 @@ private:
void extractBuffer(const OUString &id, stringmap &rVec);
static bool extractAdjustmentToMap(const OUString &id, stringmap &rVec, std::vector<WidgetAdjustmentMap>& rAdjustmentMap);
void extractButtonImage(const OUString &id, stringmap &rMap, bool bRadio);
- void extractMnemonicWidget(const OUString &id, stringmap &rMap);
void applyPackingProperties(vcl::Window* pCurrent, vcl::Window* pParent,
const stringmap& rPackingProperties) override;
diff --git a/include/vcl/builderbase.hxx b/include/vcl/builderbase.hxx
index 3c9ab89b9110..55f46c67a6e2 100644
--- a/include/vcl/builderbase.hxx
+++ b/include/vcl/builderbase.hxx
@@ -61,6 +61,19 @@ protected:
SizeGroup() {}
};
+ struct StringPair
+ {
+ OUString m_sID;
+ OUString m_sValue;
+ StringPair(OUString sId, OUString sValue)
+ : m_sID(std::move(sId))
+ , m_sValue(std::move(sValue))
+ {
+ }
+ };
+
+ typedef StringPair MnemonicWidgetMap;
+
static void collectPangoAttribute(xmlreader::XmlReader& reader, stringmap& rMap);
static void collectAtkRelationAttribute(xmlreader::XmlReader& reader, stringmap& rMap);
static void collectAtkRoleAttribute(xmlreader::XmlReader& reader, stringmap& rMap);
@@ -84,6 +97,9 @@ protected:
const std::locale& getResLocale() const;
const std::vector<SizeGroup>& getSizeGroups() const;
+ void extractMnemonicWidget(const OUString& id, stringmap& rMap);
+ const std::vector<MnemonicWidgetMap>& getMnemonicWidgetMaps() const;
+
OUString finalizeValue(const OString& rContext, const OString& rValue,
const bool bTranslate) const;
@@ -119,6 +135,8 @@ private:
std::map<OUString, Adjustment> m_aAdjustments;
std::map<OUString, TextBuffer> m_aTextBuffers;
+
+ std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps;
};
std::unique_ptr<ParserState> m_pParserState;
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2b8381f89b65..3ac7e9db7abd 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -474,6 +474,11 @@ const std::vector<BuilderBase::SizeGroup>& BuilderBase::getSizeGroups() const
return m_pParserState->m_aSizeGroups;
}
+const std::vector<BuilderBase::MnemonicWidgetMap>& BuilderBase::getMnemonicWidgetMaps() const {
+ assert(m_pParserState && "parser state no more valid");
+ return m_pParserState->m_aMnemonicWidgetMaps;
+}
+
OUString BuilderBase::finalizeValue(const OString& rContext, const OString& rValue,
const bool bTranslate) const
{
@@ -515,7 +520,7 @@ VclBuilder::VclBuilder(vcl::Window* pParent, std::u16string_view sUIDir, const O
processUIFile(pParent);
//Set Mnemonic widgets when everything has been imported
- for (auto const& mnemonicWidget : m_pVclParserState->m_aMnemonicWidgetMaps)
+ for (auto const& mnemonicWidget : getMnemonicWidgetMaps())
{
FixedText *pOne = get<FixedText>(mnemonicWidget.m_sID);
vcl::Window *pOther = get(mnemonicWidget.m_sValue);
@@ -1405,7 +1410,7 @@ void VclBuilder::extractButtonImage(const OUString &id, stringmap &rMap, bool bR
}
}
-void VclBuilder::extractMnemonicWidget(const OUString &rLabelID, stringmap &rMap)
+void BuilderBase::extractMnemonicWidget(const OUString &rLabelID, stringmap &rMap)
{
VclBuilder::stringmap::iterator aFind = rMap.find(u"mnemonic-widget"_ustr);
if (aFind != rMap.end())
@@ -1414,7 +1419,7 @@ void VclBuilder::extractMnemonicWidget(const OUString &rLabelID, stringmap &rMap
sal_Int32 nDelim = sID.indexOf(':');
if (nDelim != -1)
sID = sID.copy(0, nDelim);
- m_pVclParserState->m_aMnemonicWidgetMaps.emplace_back(rLabelID, sID);
+ m_pParserState->m_aMnemonicWidgetMaps.emplace_back(rLabelID, sID);
rMap.erase(aFind);
}
}