summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-14 15:08:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-14 17:34:47 +0100
commit2863247598b8d85e9a284575e9b657f360d21c4d (patch)
treeac606a35d1329017e3f59c7351dd6985298fc772 /vcl
parent5c093e7e1505e787a5781446aed8add83bf7f55d (diff)
move [G|S]etGetSpecialCharsFunction into its own header
so the whole of edit.hxx doesn't need to be included just to set that detail Change-Id: I467add023ca59c1ffdccbafb21843cb153ba6a40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86769 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/edit.cxx16
-rw-r--r--vcl/source/edit/vclmedit.cxx9
2 files changed, 15 insertions, 10 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 34b92941a587..72c09a1e522a 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -22,6 +22,7 @@
#include <vcl/menu.hxx>
#include <vcl/edit.hxx>
#include <vcl/weld.hxx>
+#include <vcl/specialchars.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/uitest/uiobject.hxx>
@@ -2697,14 +2698,17 @@ sal_Int32 Edit::GetMaxVisChars() const
return nCharWidth ? nOutWidth/nCharWidth : 0;
}
-void Edit::SetGetSpecialCharsFunction( FncGetSpecialChars fn )
+namespace vcl
{
- pImplFncGetSpecialChars = fn;
-}
+ void SetGetSpecialCharsFunction( FncGetSpecialChars fn )
+ {
+ pImplFncGetSpecialChars = fn;
+ }
-FncGetSpecialChars Edit::GetGetSpecialCharsFunction()
-{
- return pImplFncGetSpecialChars;
+ FncGetSpecialChars GetGetSpecialCharsFunction()
+ {
+ return pImplFncGetSpecialChars;
+ }
}
VclPtr<PopupMenu> Edit::CreatePopupMenu()
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index e21d5c4c8f57..d69b3a64ea81 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -23,6 +23,7 @@
#include <vcl/builder.hxx>
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
+#include <vcl/specialchars.hxx>
#include <vcl/timer.hxx>
#include <vcl/vclmedit.hxx>
#include <vcl/xtextedt.hxx>
@@ -710,11 +711,11 @@ void TextWindow::KeyInput( const KeyEvent& rKEvent )
}
else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
{
- if ( Edit::GetGetSpecialCharsFunction() )
+ if ( vcl::GetGetSpecialCharsFunction() )
{
// to maintain the selection
mbActivePopup = true;
- OUString aChars = Edit::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
+ OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
if (!aChars.isEmpty())
{
mpExtTextView->InsertText( aChars );
@@ -782,7 +783,7 @@ void TextWindow::Command( const CommandEvent& rCEvt )
pPopup->EnableItem(pPopup->GetItemId("paste"), bEnablePaste);
pPopup->EnableItem(pPopup->GetItemId("specialchar"), bEnableSpecialChar);
pPopup->EnableItem(pPopup->GetItemId("undo"), bEnableUndo);
- pPopup->ShowItem(pPopup->GetItemId("specialchar"), !Edit::GetGetSpecialCharsFunction());
+ pPopup->ShowItem(pPopup->GetItemId("specialchar"), !vcl::GetGetSpecialCharsFunction());
mbActivePopup = true;
Point aPos = rCEvt.GetMousePosPixel();
@@ -828,7 +829,7 @@ void TextWindow::Command( const CommandEvent& rCEvt )
}
else if (sCommand == "specialchar")
{
- OUString aChars = Edit::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
+ OUString aChars = vcl::GetGetSpecialCharsFunction()(GetFrameWeld(), GetFont());
if (!aChars.isEmpty())
{
mpExtTextView->InsertText( aChars );