summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/editview.cxx8
-rw-r--r--include/editeng/editview.hxx2
-rw-r--r--sw/source/uibase/shells/langhelper.cxx8
3 files changed, 11 insertions, 7 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index b101f7f08b85..5f3fb49e7a08 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -351,6 +351,14 @@ OutputDevice& EditView::GetOutputDevice() const
return pImpEditView->GetOutputDevice();
}
+LanguageType EditView::GetInputLanguage() const
+{
+ // it might make sense to add this to getEditViewCallbacks
+ if (const vcl::Window* pWindow = GetWindow())
+ return pWindow->GetInputLanguage();
+ return LANGUAGE_DONTKNOW;
+}
+
bool EditView::HasOtherViewWindow( vcl::Window* pWin )
{
OutWindowSet& rOutWindowSet = pImpEditView->aOutWindowSet;
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 379218b1c619..6e06cdd77a97 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -171,6 +171,8 @@ public:
vcl::Window* GetWindow() const;
OutputDevice& GetOutputDevice() const;
+ LanguageType GetInputLanguage() const;
+
bool HasOtherViewWindow( vcl::Window* pWin );
bool AddOtherViewWindow( vcl::Window* pWin );
bool RemoveOtherViewWindow( vcl::Window* pWin );
diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx
index aa7f5ae06089..b5ceb23e5ddb 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -19,8 +19,6 @@
#include <string.h>
-#include <vcl/window.hxx>
-
#include <wrtsh.hxx>
#include <doc.hxx>
#include <docary.hxx>
@@ -67,11 +65,7 @@ namespace SwLangHelper
// get keyboard language
OUString aKeyboardLang;
- LanguageType nLang = LANGUAGE_DONTKNOW;
-
- vcl::Window* pWin = rEditView.GetWindow();
- if(pWin)
- nLang = pWin->GetInputLanguage();
+ LanguageType nLang = rEditView.GetInputLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
aKeyboardLang = SvtLanguageTable::GetLanguageString( nLang );