Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3f1dd0f6
Kaydet (Commit)
3f1dd0f6
authored
Ara 06, 2012
tarafından
Ariel Constenla-Haile
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i121442# - Refactor UNO StatusbarControllers
üst
6c640ee4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
165 deletions
+51
-165
langselectionstatusbarcontroller.hxx
framework/inc/uielement/langselectionstatusbarcontroller.hxx
+2
-20
langselectionstatusbarcontroller.cxx
...ork/source/uielement/langselectionstatusbarcontroller.cxx
+49
-145
No files found.
framework/inc/uielement/langselectionstatusbarcontroller.hxx
Dosyayı görüntüle @
3f1dd0f6
...
@@ -51,36 +51,18 @@ class LangSelectionStatusbarController : public svt::StatusbarController
...
@@ -51,36 +51,18 @@ class LangSelectionStatusbarController : public svt::StatusbarController
// XServiceInfo
// XServiceInfo
DECLARE_XSERVICEINFO
DECLARE_XSERVICEINFO
// XInterface
virtual
::
com
::
sun
::
star
::
uno
::
Any
SAL_CALL
queryInterface
(
const
::
com
::
sun
::
star
::
uno
::
Type
&
aType
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
acquire
()
throw
();
virtual
void
SAL_CALL
release
()
throw
();
// XInitialization
// XInitialization
virtual
void
SAL_CALL
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
aArguments
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
aArguments
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XComponent
virtual
void
SAL_CALL
dispose
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XEventListener
virtual
void
SAL_CALL
disposing
(
const
com
::
sun
::
star
::
lang
::
EventObject
&
Source
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XStatusListener
// XStatusListener
virtual
void
SAL_CALL
statusChanged
(
const
::
com
::
sun
::
star
::
frame
::
FeatureStateEvent
&
Event
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
statusChanged
(
const
::
com
::
sun
::
star
::
frame
::
FeatureStateEvent
&
Event
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XStatusbarController
// XStatusbarController
virtual
::
sal_Bool
SAL_CALL
mouseButtonDown
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
aMouseEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
::
sal_Bool
SAL_CALL
mouseMove
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
aMouseEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
::
sal_Bool
SAL_CALL
mouseButtonUp
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
aMouseEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
command
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
,
virtual
void
SAL_CALL
command
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
,
::
sal_Int32
nCommand
,
::
sal_Int32
nCommand
,
::
sal_Bool
bMouseEvent
,
::
sal_Bool
bMouseEvent
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
aData
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
const
::
com
::
sun
::
star
::
uno
::
Any
&
aData
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
paint
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XGraphics
>&
xGraphics
,
virtual
void
SAL_CALL
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
nItemId
,
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
click
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
doubleClick
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
private
:
private
:
virtual
~
LangSelectionStatusbarController
()
{}
virtual
~
LangSelectionStatusbarController
()
{}
...
@@ -95,7 +77,7 @@ class LangSelectionStatusbarController : public svt::StatusbarController
...
@@ -95,7 +77,7 @@ class LangSelectionStatusbarController : public svt::StatusbarController
::
rtl
::
OUString
m_aGuessedTextLang
;
// the 'guessed' language for the selection, "" if none could be guessed
::
rtl
::
OUString
m_aGuessedTextLang
;
// the 'guessed' language for the selection, "" if none could be guessed
LanguageGuessingHelper
m_aLangGuessHelper
;
LanguageGuessingHelper
m_aLangGuessHelper
;
void
LangMenu
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
LangMenu
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
};
};
}
// framework namespace
}
// framework namespace
...
...
framework/source/uielement/langselectionstatusbarcontroller.cxx
Dosyayı görüntüle @
3f1dd0f6
...
@@ -32,9 +32,6 @@
...
@@ -32,9 +32,6 @@
#include <vcl/svapp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/window.hxx>
#include <vcl/status.hxx>
#include <vcl/status.hxx>
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
#endif
#include <toolkit/helper/convert.hxx>
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
...
@@ -60,7 +57,7 @@
...
@@ -60,7 +57,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <toolkit/
unohlp
.hxx>
#include <toolkit/
helper/vclunohelper
.hxx>
#include <tools/gen.hxx>
#include <tools/gen.hxx>
#include <com/sun/star/awt/Command.hpp>
#include <com/sun/star/awt/Command.hpp>
#include <svl/languageoptions.hxx>
#include <svl/languageoptions.hxx>
...
@@ -69,6 +66,8 @@
...
@@ -69,6 +66,8 @@
#include "helper/mischelper.hxx"
#include "helper/mischelper.hxx"
#include <rtl/ustrbuf.hxx>
#include <map>
#include <map>
#include <set>
#include <set>
...
@@ -81,13 +80,12 @@ using namespace ::com::sun::star::i18n;
...
@@ -81,13 +80,12 @@ using namespace ::com::sun::star::i18n;
using
namespace
::
com
::
sun
::
star
::
document
;
using
namespace
::
com
::
sun
::
star
::
document
;
using
::
rtl
::
OUString
;
using
::
rtl
::
OUString
;
using
::
rtl
::
OUStringBuffer
;
namespace
framework
namespace
framework
{
{
////////////////////////////////////////////////////////////
DEFINE_XSERVICEINFO_MULTISERVICE
(
LangSelectionStatusbarController
,
DEFINE_XSERVICEINFO_MULTISERVICE
(
LangSelectionStatusbarController
,
OWeakObject
,
OWeakObject
,
SERVICENAME_STATUSBARCONTROLLER
,
SERVICENAME_STATUSBARCONTROLLER
,
...
@@ -104,23 +102,6 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
...
@@ -104,23 +102,6 @@ LangSelectionStatusbarController::LangSelectionStatusbarController( const uno::R
{
{
}
}
// XInterface
Any
SAL_CALL
LangSelectionStatusbarController
::
queryInterface
(
const
Type
&
rType
)
throw
(
RuntimeException
)
{
return
svt
::
StatusbarController
::
queryInterface
(
rType
);
}
void
SAL_CALL
LangSelectionStatusbarController
::
acquire
()
throw
()
{
svt
::
StatusbarController
::
acquire
();
}
void
SAL_CALL
LangSelectionStatusbarController
::
release
()
throw
()
{
svt
::
StatusbarController
::
release
();
}
void
SAL_CALL
LangSelectionStatusbarController
::
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
aArguments
)
void
SAL_CALL
LangSelectionStatusbarController
::
initialize
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
aArguments
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
throw
(
::
com
::
sun
::
star
::
uno
::
Exception
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
{
...
@@ -129,59 +110,14 @@ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException
...
@@ -129,59 +110,14 @@ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException
svt
::
StatusbarController
::
initialize
(
aArguments
);
svt
::
StatusbarController
::
initialize
(
aArguments
);
if
(
m_x
ParentWindow
.
is
()
&&
m_nID
>
0
)
if
(
m_x
StatusbarItem
.
is
()
)
{
{
Window
*
pWindow
=
VCLUnoHelper
::
GetWindow
(
m_xParentWindow
);
m_xStatusbarItem
->
setText
(
String
(
FwkResId
(
STR_LANGSTATUS_MULTIPLE_LANGUAGES
)
)
);
if
(
pWindow
&&
(
pWindow
->
GetType
()
==
WINDOW_STATUSBAR
))
{
StatusBar
*
pStatusBar
=
(
StatusBar
*
)
pWindow
;
pStatusBar
->
SetItemText
(
m_nID
,
FwkResId
(
STR_LANGSTATUS_MULTIPLE_LANGUAGES
)
);
}
}
}
}
}
// XComponent
void
LangSelectionStatusbarController
::
LangMenu
(
void
SAL_CALL
LangSelectionStatusbarController
::
dispose
()
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::dispose"
);
svt
::
StatusbarController
::
dispose
();
}
// XEventListener
void
SAL_CALL
LangSelectionStatusbarController
::
disposing
(
const
com
::
sun
::
star
::
lang
::
EventObject
&
Source
)
throw
(
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::disposing"
);
svt
::
StatusbarController
::
disposing
(
Source
);
}
// XStatusbarController
::
sal_Bool
SAL_CALL
LangSelectionStatusbarController
::
mouseButtonDown
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::mouseButtonDown"
);
return
sal_False
;
}
::
sal_Bool
SAL_CALL
LangSelectionStatusbarController
::
mouseMove
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::mouseMove"
);
return
sal_False
;
}
::
sal_Bool
SAL_CALL
LangSelectionStatusbarController
::
mouseButtonUp
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::mouseButtonUp"
);
return
sal_False
;
}
void
LangSelectionStatusbarController
::
LangMenu
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::LangMenu"
);
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::LangMenu"
);
...
@@ -218,7 +154,7 @@ throw (::com::sun::star::uno::RuntimeException)
...
@@ -218,7 +154,7 @@ throw (::com::sun::star::uno::RuntimeException)
{
{
DBG_ASSERT
(
MID_LANG_SEL_1
<=
nItemId
&&
nItemId
<=
MID_LANG_SEL_9
,
DBG_ASSERT
(
MID_LANG_SEL_1
<=
nItemId
&&
nItemId
<=
MID_LANG_SEL_9
,
"nItemId outside of expected range!"
);
"nItemId outside of expected range!"
);
xPopupMenu
->
insertItem
(
nItemId
,
rStr
,
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
nItemId
);
xPopupMenu
->
insertItem
(
nItemId
,
rStr
,
0
,
nItemId
);
if
(
rStr
==
m_aCurLang
)
if
(
rStr
==
m_aCurLang
)
{
{
//make a sign for the current language
//make a sign for the current language
...
@@ -228,9 +164,9 @@ throw (::com::sun::star::uno::RuntimeException)
...
@@ -228,9 +164,9 @@ throw (::com::sun::star::uno::RuntimeException)
++
nItemId
;
++
nItemId
;
}
}
}
}
xPopupMenu
->
insertItem
(
MID_LANG_SEL_NONE
,
String
(
FwkResId
(
STR_LANGSTATUS_NONE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_SEL_NONE
);
xPopupMenu
->
insertItem
(
MID_LANG_SEL_NONE
,
String
(
FwkResId
(
STR_LANGSTATUS_NONE
)),
0
,
MID_LANG_SEL_NONE
);
xPopupMenu
->
insertItem
(
MID_LANG_SEL_RESET
,
String
(
FwkResId
(
STR_RESET_TO_DEFAULT_LANGUAGE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_SEL_RESET
);
xPopupMenu
->
insertItem
(
MID_LANG_SEL_RESET
,
String
(
FwkResId
(
STR_RESET_TO_DEFAULT_LANGUAGE
)),
0
,
MID_LANG_SEL_RESET
);
xPopupMenu
->
insertItem
(
MID_LANG_SEL_MORE
,
String
(
FwkResId
(
STR_LANGSTATUS_MORE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_SEL_MORE
);
xPopupMenu
->
insertItem
(
MID_LANG_SEL_MORE
,
String
(
FwkResId
(
STR_LANGSTATUS_MORE
)),
0
,
MID_LANG_SEL_MORE
);
//
//
// add entries to submenu ('set language for paragraph')
// add entries to submenu ('set language for paragraph')
...
@@ -245,20 +181,20 @@ throw (::com::sun::star::uno::RuntimeException)
...
@@ -245,20 +181,20 @@ throw (::com::sun::star::uno::RuntimeException)
{
{
DBG_ASSERT
(
MID_LANG_PARA_1
<=
nItemId
&&
nItemId
<=
MID_LANG_PARA_9
,
DBG_ASSERT
(
MID_LANG_PARA_1
<=
nItemId
&&
nItemId
<=
MID_LANG_PARA_9
,
"nItemId outside of expected range!"
);
"nItemId outside of expected range!"
);
subPopupMenu
->
insertItem
(
nItemId
,
rStr
,
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
nItemId
);
subPopupMenu
->
insertItem
(
nItemId
,
rStr
,
0
,
nItemId
);
aLangMap
[
nItemId
]
=
rStr
;
aLangMap
[
nItemId
]
=
rStr
;
++
nItemId
;
++
nItemId
;
}
}
}
}
subPopupMenu
->
insertItem
(
MID_LANG_PARA_NONE
,
String
(
FwkResId
(
STR_LANGSTATUS_NONE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_PARA_NONE
);
subPopupMenu
->
insertItem
(
MID_LANG_PARA_NONE
,
String
(
FwkResId
(
STR_LANGSTATUS_NONE
)),
0
,
MID_LANG_PARA_NONE
);
subPopupMenu
->
insertItem
(
MID_LANG_PARA_RESET
,
String
(
FwkResId
(
STR_RESET_TO_DEFAULT_LANGUAGE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_PARA_RESET
);
subPopupMenu
->
insertItem
(
MID_LANG_PARA_RESET
,
String
(
FwkResId
(
STR_RESET_TO_DEFAULT_LANGUAGE
)),
0
,
MID_LANG_PARA_RESET
);
subPopupMenu
->
insertItem
(
MID_LANG_PARA_MORE
,
String
(
FwkResId
(
STR_LANGSTATUS_MORE
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_PARA_MORE
);
subPopupMenu
->
insertItem
(
MID_LANG_PARA_MORE
,
String
(
FwkResId
(
STR_LANGSTATUS_MORE
)),
0
,
MID_LANG_PARA_MORE
);
//
//
// add last two entries to main menu
// add last two entries to main menu
//
//
xPopupMenu
->
insertSeparator
(
MID_LANG_PARA_SEPERATOR
);
xPopupMenu
->
insertSeparator
(
MID_LANG_PARA_SEPERATOR
);
xPopupMenu
->
insertItem
(
MID_LANG_PARA_STRING
,
String
(
FwkResId
(
STR_SET_LANGUAGE_FOR_PARAGRAPH
)),
css
::
awt
::
MenuItemStyle
::
RADIOCHECK
,
MID_LANG_PARA_STRING
);
xPopupMenu
->
insertItem
(
MID_LANG_PARA_STRING
,
String
(
FwkResId
(
STR_SET_LANGUAGE_FOR_PARAGRAPH
)),
0
,
MID_LANG_PARA_STRING
);
xPopupMenu
->
setPopupMenu
(
MID_LANG_PARA_STRING
,
subPopupMenu
);
xPopupMenu
->
setPopupMenu
(
MID_LANG_PARA_STRING
,
subPopupMenu
);
...
@@ -267,79 +203,65 @@ throw (::com::sun::star::uno::RuntimeException)
...
@@ -267,79 +203,65 @@ throw (::com::sun::star::uno::RuntimeException)
//
//
Reference
<
awt
::
XWindowPeer
>
xParent
(
m_xParentWindow
,
UNO_QUERY
);
Reference
<
awt
::
XWindowPeer
>
xParent
(
m_xParentWindow
,
UNO_QUERY
);
com
::
sun
::
star
::
awt
::
Rectangle
aRectangle
;
com
::
sun
::
star
::
awt
::
Rectangle
aRectangle
;
Window
*
pWindow
=
VCLUnoHelper
::
GetWindow
(
m_xParentWindow
);
aRectangle
.
X
=
aPos
.
X
;
const
Point
mMousePos
=
pWindow
->
GetPointerPosPixel
();
aRectangle
.
Y
=
aPos
.
Y
;
aRectangle
.
X
=
mMousePos
.
X
();
aRectangle
.
Y
=
mMousePos
.
Y
();
sal_Int16
nId
=
xPopupMenu
->
execute
(
xParent
,
aRectangle
,
com
::
sun
::
star
::
awt
::
PopupMenuDirection
::
EXECUTE_UP
+
16
);
sal_Int16
nId
=
xPopupMenu
->
execute
(
xParent
,
aRectangle
,
com
::
sun
::
star
::
awt
::
PopupMenuDirection
::
EXECUTE_UP
+
16
);
//click "More..."
//click "More..."
if
(
nId
&&
m_xFrame
.
is
()
)
if
(
nId
&&
m_xFrame
.
is
()
)
{
{
uno
::
Reference
<
XDispatchProvider
>
xDispatchProvider
(
m_xFrame
,
UNO_QUERY
);
OUStringBuffer
aBuff
;
util
::
URL
aURL
;
//set selected language as current language for selection
const
OUString
aSelectedLang
=
aLangMap
[
nId
];
if
(
MID_LANG_SEL_1
<=
nId
&&
nId
<=
MID_LANG_SEL_9
)
if
(
MID_LANG_SEL_1
<=
nId
&&
nId
<=
MID_LANG_SEL_9
)
{
{
//set selected language as current language for selection
aBuff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Current_"
)
));
String
aSelectedLang
=
aLangMap
[
nId
];
aBuff
.
append
(
aSelectedLang
);
aURL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Current_"
);
aURL
.
Complete
+=
aSelectedLang
;
}
}
else
if
(
nId
==
MID_LANG_SEL_NONE
)
else
if
(
nId
==
MID_LANG_SEL_NONE
)
{
{
//set None as current language for selection
//set None as current language for selection
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE"
)
)
);
}
}
else
if
(
nId
==
MID_LANG_SEL_RESET
)
else
if
(
nId
==
MID_LANG_SEL_RESET
)
{
{
// reset language attributes for selection
// reset language attributes for selection
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES"
)
)
);
}
}
else
if
(
nId
==
MID_LANG_SEL_MORE
)
else
if
(
nId
==
MID_LANG_SEL_MORE
)
{
{
//open the dialog "format/character" for current selection
//open the dialog "format/character" for current selection
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:FontDialog?Language:string=*"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:FontDialog?Language:string=*"
)
)
);
}
}
else
if
(
MID_LANG_PARA_1
<=
nId
&&
nId
<=
MID_LANG_PARA_9
)
else
if
(
MID_LANG_PARA_1
<=
nId
&&
nId
<=
MID_LANG_PARA_9
)
{
{
//set selected language for current paragraph
aBuff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Paragraph_"
)
));
String
aSelectedLang
=
aLangMap
[
nId
];
aBuff
.
append
(
aSelectedLang
);
aURL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Paragraph_"
);
aURL
.
Complete
+=
aSelectedLang
;
}
}
else
if
(
nId
==
MID_LANG_PARA_NONE
)
else
if
(
nId
==
MID_LANG_PARA_NONE
)
{
{
//set None as language for current paragraph
//set None as language for current paragraph
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE"
)
)
);
}
}
else
if
(
nId
==
MID_LANG_PARA_RESET
)
else
if
(
nId
==
MID_LANG_PARA_RESET
)
{
{
// reset language attributes for paragraph
// reset language attributes for paragraph
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES"
)
)
);
}
}
else
if
(
nId
==
MID_LANG_PARA_MORE
)
else
if
(
nId
==
MID_LANG_PARA_MORE
)
{
{
//open the dialog "format/character" for current paragraph
//open the dialog "format/character" for current paragraph
a
URL
.
Complete
+=
OUString
::
createFromAscii
(
".uno:FontDialogForParagraph"
);
a
Buff
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
(
".uno:FontDialogForParagraph"
)
)
);
}
}
uno
::
Reference
<
util
::
XURLTransformer
>
xURLTransformer
(
m_xServiceManager
->
createInstance
(
OUString
::
createFromAscii
(
"com.sun.star.util.URLTransformer"
)),
uno
::
UNO_QUERY
);
const
Sequence
<
beans
::
PropertyValue
>
aDummyArgs
;
xURLTransformer
->
parseStrict
(
aURL
);
execute
(
aBuff
.
makeStringAndClear
(),
aDummyArgs
);
uno
::
Reference
<
XDispatch
>
xDispatch
=
xDispatchProvider
->
queryDispatch
(
aURL
,
OUString
(),
0
);
if
(
xDispatch
.
is
()
)
{
uno
::
Sequence
<
beans
::
PropertyValue
>
aPV
;
if
(
::
comphelper
::
UiEventsLogger
::
isEnabled
())
//#i88653#
UiEventLogHelper
(
OUString
::
createFromAscii
(
"ButtonToolbarController"
)).
log
(
m_xServiceManager
,
m_xFrame
,
aURL
,
aPV
);
xDispatch
->
dispatch
(
aURL
,
aPV
);
}
}
}
}
}
void
SAL_CALL
LangSelectionStatusbarController
::
command
(
void
SAL_CALL
LangSelectionStatusbarController
::
command
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
/*aPos*/
,
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
,
::
sal_Int32
nCommand
,
::
sal_Int32
nCommand
,
::
sal_Bool
/*bMouseEvent*/
,
::
sal_Bool
/*bMouseEvent*/
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
/*aData*/
)
const
::
com
::
sun
::
star
::
uno
::
Any
&
/*aData*/
)
...
@@ -348,33 +270,16 @@ throw (::com::sun::star::uno::RuntimeException)
...
@@ -348,33 +270,16 @@ throw (::com::sun::star::uno::RuntimeException)
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::command"
);
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::command"
);
if
(
nCommand
&
::
awt
::
Command
::
CONTEXTMENU
)
if
(
nCommand
&
::
awt
::
Command
::
CONTEXTMENU
)
{
{
LangMenu
();
LangMenu
(
aPos
);
}
}
}
}
void
SAL_CALL
LangSelectionStatusbarController
::
paint
(
void
SAL_CALL
LangSelectionStatusbarController
::
click
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XGraphics
>&
xGraphics
,
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
nItemId
,
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::paint"
);
svt
::
StatusbarController
::
paint
(
xGraphics
,
rOutputRectangle
,
nItemId
,
nStyle
);
}
void
SAL_CALL
LangSelectionStatusbarController
::
click
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::click"
);
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::click"
);
LangMenu
();
LangMenu
(
aPos
);
}
void
SAL_CALL
LangSelectionStatusbarController
::
doubleClick
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"framework"
,
"Ocke.Janssen@sun.com"
,
"LangSelectionStatusbarController::doubleClick"
);
svt
::
StatusbarController
::
doubleClick
();
}
}
// XStatusListener
// XStatusListener
...
@@ -395,26 +300,25 @@ throw ( RuntimeException )
...
@@ -395,26 +300,25 @@ throw ( RuntimeException )
return
;
return
;
m_bShowMenu
=
sal_True
;
m_bShowMenu
=
sal_True
;
m_nScriptType
=
LS_SCRIPT_LATIN
|
LS_SCRIPT_ASIAN
|
LS_SCRIPT_COMPLEX
;
//set the default value
m_nScriptType
=
LS_SCRIPT_LATIN
|
LS_SCRIPT_ASIAN
|
LS_SCRIPT_COMPLEX
;
//set the default value
Window
*
pWindow
=
VCLUnoHelper
::
GetWindow
(
m_xParentWindow
);
if
(
pWindow
&&
pWindow
->
GetType
()
==
WINDOW_STATUSBAR
&&
m_nID
!=
0
)
if
(
m_xStatusbarItem
.
is
()
)
{
{
OUString
aStrValue
;
OUString
aStrValue
;
Sequence
<
OUString
>
aSeq
;
Sequence
<
OUString
>
aSeq
;
StatusBar
*
pStatusBar
=
(
StatusBar
*
)
pWindow
;
if
(
Event
.
State
>>=
aStrValue
)
if
(
Event
.
State
>>=
aStrValue
)
pStatusBar
->
SetItemText
(
m_nID
,
aStrValue
);
m_xStatusbarItem
->
setText
(
aStrValue
);
else
if
(
Event
.
State
>>=
aSeq
)
else
if
(
Event
.
State
>>=
aSeq
)
{
{
if
(
aSeq
.
getLength
()
==
4
)
if
(
aSeq
.
getLength
()
==
4
)
{
{
const
String
aMultipleLangText
(
FwkResId
(
STR_LANGSTATUS_MULTIPLE_LANGUAGES
)
);
OUString
aStatusText
=
aSeq
[
0
];
OUString
aStatusText
=
aSeq
[
0
];
if
(
0
==
aStatusText
.
compareToAscii
(
"*"
))
if
(
0
==
aStatusText
.
compareToAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"*"
)
))
aStatusText
=
aMultipleLangText
;
{
pStatusBar
->
SetItemText
(
m_nID
,
aStatusText
);
aStatusText
=
String
(
FwkResId
(
STR_LANGSTATUS_MULTIPLE_LANGUAGES
)
);
}
m_xStatusbarItem
->
setText
(
aStatusText
);
// Retrieve all other values from the sequence and
// Retrieve all other values from the sequence and
// store it members!
// store it members!
...
@@ -426,7 +330,7 @@ throw ( RuntimeException )
...
@@ -426,7 +330,7 @@ throw ( RuntimeException )
}
}
else
if
(
!
Event
.
State
.
hasValue
()
)
else
if
(
!
Event
.
State
.
hasValue
()
)
{
{
pStatusBar
->
SetItemText
(
m_nID
,
String
()
);
m_xStatusbarItem
->
setText
(
OU
String
()
);
m_bShowMenu
=
sal_False
;
// no language -> no menu
m_bShowMenu
=
sal_False
;
// no language -> no menu
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment