summaryrefslogtreecommitdiffstats
path: root/extensions/source/bibliography/toolbar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography/toolbar.cxx')
-rw-r--r--extensions/source/bibliography/toolbar.cxx73
1 files changed, 33 insertions, 40 deletions
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 8d32a1f4d205..e4041c5a80f1 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
+#include <comphelper/propertyvalue.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
@@ -30,6 +31,7 @@
#include <o3tl/any.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/imgdef.hxx>
+#include <utility>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/mnemonic.hxx>
@@ -47,9 +49,9 @@ using namespace ::com::sun::star::beans;
// Constants --------------------------------------------------------------
-BibToolBarListener::BibToolBarListener(BibToolBar *pTB, const OUString& aStr, ToolBoxItemId nId):
+BibToolBarListener::BibToolBarListener(BibToolBar *pTB, OUString aStr, ToolBoxItemId nId):
nIndex(nId),
- aCommand(aStr),
+ aCommand(std::move(aStr)),
pToolBar(pTB)
{
}
@@ -233,8 +235,7 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink)
, aLayoutManager(aLink)
, nSymbolsSize(SFX_SYMBOLS_SIZE_SMALL)
{
- SvtMiscOptions aSvtMiscOptions;
- nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize();
+ nSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize();
xSource->Show();
pLbSource->connect_changed(LINK( this, BibToolBar, SelHdl));
@@ -348,14 +349,11 @@ void BibToolBar::Select()
}
else
{
- Sequence<PropertyValue> aPropVal(2);
- PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
- pPropertyVal[0].Name="QueryText";
- OUString aSelection = pEdQuery->get_text();
- pPropertyVal[0].Value <<= aSelection;
-
- pPropertyVal[1].Name="QueryField";
- pPropertyVal[1].Value <<= aQueryField;
+ Sequence<PropertyValue> aPropVal
+ {
+ comphelper::makePropertyValue("QueryText", pEdQuery->get_text()),
+ comphelper::makePropertyValue("QueryField", aQueryField)
+ };
SendDispatch(nId,aPropVal);
}
}
@@ -425,7 +423,7 @@ sal_uInt16 BibToolBar::InsertFilterItem(const OUString& rMenuEntry)
void BibToolBar::SelectFilterItem(sal_uInt16 nId)
{
- OString sId = OString::number(nId);
+ OUString sId = OUString::number(nId);
xPopupMenu->set_active(sId, true);
sSelMenuItem = sId;
aQueryField = MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId));
@@ -473,20 +471,18 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
{
bool bResult = true;
- MouseNotifyEvent nSwitch=rNEvt.GetType();
- if (pEdQuery && pEdQuery->has_focus() && nSwitch == MouseNotifyEvent::KEYINPUT)
+ NotifyEventType nSwitch=rNEvt.GetType();
+ if (pEdQuery && pEdQuery->has_focus() && nSwitch == NotifyEventType::KEYINPUT)
{
const vcl::KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode();
sal_uInt16 nKey = aKeyCode.GetCode();
if(nKey == KEY_RETURN)
{
- Sequence<PropertyValue> aPropVal(2);
- PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
- pPropertyVal[0].Name = "QueryText";
- OUString aSelection = pEdQuery->get_text();
- pPropertyVal[0].Value <<= aSelection;
- pPropertyVal[1].Name="QueryField";
- pPropertyVal[1].Value <<= aQueryField;
+ Sequence<PropertyValue> aPropVal
+ {
+ comphelper::makePropertyValue("QueryText", pEdQuery->get_text()),
+ comphelper::makePropertyValue("QueryField", aQueryField)
+ };
SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
return bResult;
}
@@ -505,11 +501,10 @@ IMPL_LINK_NOARG( BibToolBar, SelHdl, weld::ComboBox&, void )
IMPL_LINK_NOARG( BibToolBar, SendSelHdl, Timer*, void )
{
- Sequence<PropertyValue> aPropVal(1);
- PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
- pPropertyVal[0].Name = "DataSourceName";
- OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( pLbSource->get_active_text() ) );
- pPropertyVal[0].Value <<= aEntry;
+ Sequence<PropertyValue> aPropVal
+ {
+ comphelper::makePropertyValue("DataSourceName", MnemonicGenerator::EraseAllMnemonicChars( pLbSource->get_active_text() ))
+ };
SendDispatch(nTBC_SOURCE, aPropVal);
}
@@ -525,7 +520,7 @@ IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void)
tools::Rectangle aRect(GetItemRect(nTBC_BT_AUTOFILTER));
weld::Window* pParent = weld::GetPopupParent(*this, aRect);
- OString sId = xPopupMenu->popup_at_rect(pParent, aRect);
+ OUString sId = xPopupMenu->popup_at_rect(pParent, aRect);
if (!sId.isEmpty())
{
@@ -533,13 +528,11 @@ IMPL_LINK_NOARG(BibToolBar, MenuHdl, ToolBox*, void)
xPopupMenu->set_active(sId, true);
sSelMenuItem = sId;
aQueryField = MnemonicGenerator::EraseAllMnemonicChars(xPopupMenu->get_label(sId));
- Sequence<PropertyValue> aPropVal(2);
- PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
- pPropertyVal[0].Name = "QueryText";
- OUString aSelection = pEdQuery->get_text();
- pPropertyVal[0].Value <<= aSelection;
- pPropertyVal[1].Name="QueryField";
- pPropertyVal[1].Value <<= aQueryField;
+ Sequence<PropertyValue> aPropVal
+ {
+ comphelper::makePropertyValue("QueryText", pEdQuery->get_text()),
+ comphelper::makePropertyValue("QueryField", aQueryField)
+ };
SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
}
@@ -567,7 +560,7 @@ void BibToolBar::DataChanged( const DataChangedEvent& rDCEvt )
IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void )
{
bool bRebuildToolBar = false;
- sal_Int16 eSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize();
+ sal_Int16 eSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize();
if ( nSymbolsSize != eSymbolsSize )
{
nSymbolsSize = eSymbolsSize;
@@ -581,7 +574,7 @@ IMPL_LINK_NOARG( BibToolBar, OptionsChanged_Impl, LinkParamNone*, void )
IMPL_LINK_NOARG( BibToolBar, SettingsChanged_Impl, VclSimpleEvent&, void )
{
// Check if toolbar button size have changed and we have to use system settings
- sal_Int16 eSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize();
+ sal_Int16 eSymbolsSize = SvtMiscOptions::GetCurrentSymbolsSize();
if ( eSymbolsSize != nSymbolsSize )
{
nSymbolsSize = eSymbolsSize;
@@ -598,9 +591,9 @@ void BibToolBar::RebuildToolbar()
void BibToolBar::ApplyImageList()
{
- SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_AUTOFILTER_SC) : OUString(RID_EXTBMP_AUTOFILTER_LC)));
- SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_FILTERCRIT_SC) : OUString(RID_EXTBMP_FILTERCRIT_LC)));
- SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? OUString(RID_EXTBMP_REMOVE_FILTER_SORT_SC) : OUString(RID_EXTBMP_REMOVE_FILTER_SORT_LC)));
+ SetItemImage(nTBC_BT_AUTOFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_AUTOFILTER_SC : RID_EXTBMP_AUTOFILTER_LC));
+ SetItemImage(nTBC_BT_FILTERCRIT, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_FILTERCRIT_SC : RID_EXTBMP_FILTERCRIT_LC));
+ SetItemImage(nTBC_BT_REMOVEFILTER, Image(StockImage::Yes, nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ? RID_EXTBMP_REMOVE_FILTER_SORT_SC : RID_EXTBMP_REMOVE_FILTER_SORT_LC));
AdjustToolBox();
}