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
6c640ee4
Kaydet (Commit)
6c640ee4
authored
Ara 06, 2012
tarafından
Ariel Constenla-Haile
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i121442# - Adapt existing code in other modules
üst
0b3a7747
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
125 deletions
+116
-125
statusbarcontroller.hxx
reportdesign/source/ui/inc/statusbarcontroller.hxx
+7
-8
statusbarcontroller.cxx
reportdesign/source/ui/misc/statusbarcontroller.cxx
+36
-28
stbitem.hxx
sfx2/inc/sfx2/stbitem.hxx
+4
-4
stbitem.cxx
sfx2/source/statbar/stbitem.cxx
+3
-4
statusbarcontroller.hxx
svtools/inc/svtools/statusbarcontroller.hxx
+6
-9
statusbarcontroller.cxx
svtools/source/uno/statusbarcontroller.cxx
+60
-72
No files found.
reportdesign/source/ui/inc/statusbarcontroller.hxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -27,20 +27,19 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/implementationreference.hxx>
class
SfxStatusBarControl
;
namespace
rptui
{
typedef
::
comphelper
::
ImplementationReference
<
SfxStatusBarControl
,
::
com
::
sun
::
star
::
frame
::
XStatusbarController
>
TStatusbarHelper
;
typedef
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XStatusbarController
>
TStatusbarRef
;
typedef
::
cppu
::
ImplHelper1
<
::
com
::
sun
::
star
::
lang
::
XServiceInfo
>
OStatusbarController_BASE
;
class
OStatusbarController
:
public
::
svt
::
StatusbarController
,
public
OStatusbarController_BASE
{
TStatusbar
Helper
m_p
Controller
;
sal_uInt16
m_nSlotId
;
sal_uInt16
m_nId
;
TStatusbar
Ref
m_r
Controller
;
sal_uInt16
m_nSlotId
;
sal_uInt16
m_nId
;
public
:
OStatusbarController
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
_rxORB
);
...
...
@@ -79,9 +78,9 @@ namespace rptui
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
,
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
n
ItemId
,
::
sal_Int32
n
Style
)
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
);
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
doubleClick
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
};
}
#endif // DBAUI_STATUSBARCONTROLLER_HXX
...
...
reportdesign/source/ui/misc/statusbarcontroller.cxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -105,19 +105,25 @@ void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArgumen
break
;
}
}
SfxStatusBarControl
*
pController
=
0
;
if
(
m_aCommandURL
.
equalsAscii
(
".uno:ZoomSlider"
)
)
{
m_pController
=
TStatusbarHelper
::
createFromQuery
(
new
SvxZoomSliderControl
(
m_nSlotId
=
SID_ATTR_ZOOMSLIDER
,
m_nId
,
*
pStatusBar
)
);
pController
=
new
SvxZoomSliderControl
(
m_nSlotId
=
SID_ATTR_ZOOMSLIDER
,
m_nId
,
*
pStatusBar
);
}
// if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
else
if
(
m_aCommandURL
.
equalsAscii
(
".uno:Zoom"
)
)
{
m_pController
=
TStatusbarHelper
::
createFromQuery
(
new
SvxZoomStatusBarControl
(
m_nSlotId
=
SID_ATTR_ZOOM
,
m_nId
,
*
pStatusBar
)
);
pController
=
new
SvxZoomStatusBarControl
(
m_nSlotId
=
SID_ATTR_ZOOM
,
m_nId
,
*
pStatusBar
);
}
if
(
m_pController
.
is
()
)
if
(
pController
)
{
m_pController
->
initialize
(
_rArguments
);
m_pController
->
update
();
m_rController
.
set
(
pController
);
if
(
m_rController
.
is
()
)
{
m_rController
->
initialize
(
_rArguments
);
m_rController
->
update
();
}
}
addStatusListener
(
m_aCommandURL
);
...
...
@@ -130,7 +136,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
::
vos
::
OGuard
aSolarGuard
(
Application
::
GetSolarMutex
()
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
if
(
m_
p
Controller
.
is
()
)
if
(
m_
r
Controller
.
is
()
)
{
if
(
m_aCommandURL
.
equalsAscii
(
".uno:ZoomSlider"
)
)
{
...
...
@@ -139,7 +145,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
{
SvxZoomSliderItem
aZoomSlider
(
100
,
20
,
400
);
aZoomSlider
.
PutValue
(
_aEvent
.
State
);
static_cast
<
SvxZoomSliderControl
*>
(
m_
p
Controller
.
get
())
->
StateChanged
(
m_nSlotId
,
SFX_ITEM_AVAILABLE
,
&
aZoomSlider
);
static_cast
<
SvxZoomSliderControl
*>
(
m_
r
Controller
.
get
())
->
StateChanged
(
m_nSlotId
,
SFX_ITEM_AVAILABLE
,
&
aZoomSlider
);
}
}
// if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
else
if
(
m_aCommandURL
.
equalsAscii
(
".uno:Zoom"
)
)
...
...
@@ -149,7 +155,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
{
SvxZoomItem
aZoom
;
aZoom
.
PutValue
(
_aEvent
.
State
);
static_cast
<
SvxZoomStatusBarControl
*>
(
m_
p
Controller
.
get
())
->
StateChanged
(
m_nSlotId
,
SFX_ITEM_AVAILABLE
,
&
aZoom
);
static_cast
<
SvxZoomStatusBarControl
*>
(
m_
r
Controller
.
get
())
->
StateChanged
(
m_nSlotId
,
SFX_ITEM_AVAILABLE
,
&
aZoom
);
}
}
}
...
...
@@ -158,17 +164,17 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv
// XStatusbarController
::
sal_Bool
SAL_CALL
OStatusbarController
::
mouseButtonDown
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
_aEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
return
m_
pController
.
is
()
&&
m_pController
.
getRef
()
->
mouseButtonDown
(
_aEvent
);
return
m_
rController
.
is
()
&&
m_rController
->
mouseButtonDown
(
_aEvent
);
}
::
sal_Bool
SAL_CALL
OStatusbarController
::
mouseMove
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
_aEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
return
m_
pController
.
is
()
&&
m_pController
.
getRef
()
->
mouseMove
(
_aEvent
);
return
m_
rController
.
is
()
&&
m_rController
->
mouseMove
(
_aEvent
);
}
::
sal_Bool
SAL_CALL
OStatusbarController
::
mouseButtonUp
(
const
::
com
::
sun
::
star
::
awt
::
MouseEvent
&
_aEvent
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
return
m_
pController
.
is
()
&&
m_pController
.
getRef
()
->
mouseButtonUp
(
_aEvent
);
return
m_
rController
.
is
()
&&
m_rController
->
mouseButtonUp
(
_aEvent
);
}
void
SAL_CALL
OStatusbarController
::
command
(
...
...
@@ -178,47 +184,49 @@ void SAL_CALL OStatusbarController::command(
const
::
com
::
sun
::
star
::
uno
::
Any
&
aData
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
if
(
m_
p
Controller
.
is
()
)
m_
pController
.
getRef
()
->
command
(
aPos
,
nCommand
,
bMouseEvent
,
aData
);
if
(
m_
r
Controller
.
is
()
)
m_
rController
->
command
(
aPos
,
nCommand
,
bMouseEvent
,
aData
);
}
void
SAL_CALL
OStatusbarController
::
paint
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XGraphics
>&
xGraphics
,
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
nItemId
,
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
if
(
m_
p
Controller
.
is
()
)
m_
pController
.
getRef
()
->
paint
(
xGraphics
,
rOutputRectangle
,
nItemId
,
nStyle
);
if
(
m_
r
Controller
.
is
()
)
m_
rController
->
paint
(
xGraphics
,
rOutputRectangle
,
nStyle
);
}
void
SAL_CALL
OStatusbarController
::
click
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
void
SAL_CALL
OStatusbarController
::
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
if
(
m_
p
Controller
.
is
()
)
m_
pController
.
getRef
()
->
click
(
);
if
(
m_
r
Controller
.
is
()
)
m_
rController
->
click
(
aPos
);
}
void
SAL_CALL
OStatusbarController
::
doubleClick
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
void
SAL_CALL
OStatusbarController
::
doubleClick
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
if
(
m_
p
Controller
.
is
()
)
m_
pController
.
getRef
()
->
doubleClick
(
);
if
(
m_
r
Controller
.
is
()
)
m_
rController
->
doubleClick
(
aPos
);
}
// -----------------------------------------------------------------------------
void
SAL_CALL
OStatusbarController
::
update
()
throw
(
RuntimeException
)
{
::
svt
::
StatusbarController
::
update
();
Reference
<
XUpdatable
>
xUp
(
m_pController
.
getRef
(),
UNO_QUERY
);
if
(
xUp
.
is
()
)
xUp
->
update
();
if
(
m_rController
.
is
()
)
m_rController
->
update
();
}
// -----------------------------------------------------------------------------
// XComponent
void
SAL_CALL
OStatusbarController
::
dispose
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
Reference
<
XComponent
>
xComp
(
m_pController
.
getRef
(),
UNO_QUERY
);
::
comphelper
::
disposeComponent
(
xComp
);
m_pController
.
dispose
();
if
(
m_rController
.
is
()
)
::
comphelper
::
disposeComponent
(
m_rController
);
svt
::
StatusbarController
::
dispose
();
}
// =============================================================================
...
...
sfx2/inc/sfx2/stbitem.hxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -94,10 +94,10 @@ protected:
::
sal_Bool
bMouseEvent
,
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
,
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
);
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
doubleClick
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// Old sfx2 interface
virtual
void
StateChanged
(
sal_uInt16
nSID
,
SfxItemState
eState
,
...
...
sfx2/source/statbar/stbitem.cxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -396,7 +396,6 @@ throw (::com::sun::star::uno::RuntimeException)
void
SAL_CALL
SfxStatusBarControl
::
paint
(
const
uno
::
Reference
<
awt
::
XGraphics
>&
xGraphics
,
const
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
nItemId
,
::
sal_Int32
nStyle
)
throw
(
::
uno
::
RuntimeException
)
{
...
...
@@ -406,14 +405,14 @@ throw ( ::uno::RuntimeException )
if
(
pOutDev
)
{
::
Rectangle
aRect
=
VCLRectangle
(
rOutputRectangle
);
UserDrawEvent
aUserDrawEvent
(
pOutDev
,
aRect
,
(
sal_uInt16
)
nItemId
,
(
sal_uInt16
)
nStyle
);
UserDrawEvent
aUserDrawEvent
(
pOutDev
,
aRect
,
pBar
->
GetCurItemId
()
,
(
sal_uInt16
)
nStyle
);
Paint
(
aUserDrawEvent
);
}
}
//--------------------------------------------------------------------
void
SAL_CALL
SfxStatusBarControl
::
click
()
void
SAL_CALL
SfxStatusBarControl
::
click
(
const
awt
::
Point
&
)
throw
(
uno
::
RuntimeException
)
{
::
vos
::
OGuard
aGuard
(
Application
::
GetSolarMutex
()
);
...
...
@@ -422,7 +421,7 @@ throw ( uno::RuntimeException )
//--------------------------------------------------------------------
void
SAL_CALL
SfxStatusBarControl
::
doubleClick
()
void
SAL_CALL
SfxStatusBarControl
::
doubleClick
(
const
awt
::
Point
&
)
throw
(
uno
::
RuntimeException
)
{
::
vos
::
OGuard
aGuard
(
Application
::
GetSolarMutex
()
);
...
...
svtools/inc/svtools/statusbarcontroller.hxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -25,12 +25,10 @@
#define _SVTOOLS_STATUSBARCONTROLLER_HXX
#include "svtools/svtdllapi.h"
#include <com/sun/star/ui/XStatusbarItem.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XStatusbarController.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
...
...
@@ -48,10 +46,8 @@
namespace
svt
{
class
SVT_DLLPUBLIC
StatusbarController
:
public
::
com
::
sun
::
star
::
frame
::
XStatusListener
,
class
SVT_DLLPUBLIC
StatusbarController
:
public
::
com
::
sun
::
star
::
frame
::
XStatusbarController
,
public
::
com
::
sun
::
star
::
lang
::
XInitialization
,
public
::
com
::
sun
::
star
::
util
::
XUpdatable
,
public
::
com
::
sun
::
star
::
lang
::
XComponent
,
public
::
comphelper
::
OBaseMutex
,
public
::
cppu
::
OWeakObject
...
...
@@ -106,9 +102,9 @@ class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatu
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
,
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
rOutputRectangle
,
::
sal_Int32
n
ItemId
,
::
sal_Int32
n
Style
)
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
);
::
sal_Int32
nStyle
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
doubleClick
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
aPos
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
protected
:
struct
Listener
...
...
@@ -147,6 +143,7 @@ class SVT_DLLPUBLIC StatusbarController : public ::com::sun::star::frame::XStatu
URLToDispatchMap
m_aListenerMap
;
::
cppu
::
OMultiTypeInterfaceContainerHelper
m_aListenerContainer
;
/// container for ALL Listener
mutable
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
util
::
XURLTransformer
>
m_xURLTransformer
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
ui
::
XStatusbarItem
>
m_xStatusbarItem
;
};
}
...
...
svtools/source/uno/statusbarcontroller.cxx
Dosyayı görüntüle @
6c640ee4
...
...
@@ -35,7 +35,7 @@
#include <vcl/status.hxx>
#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
#include <toolkit/
unohlp
.hxx>
#include <toolkit/
helper/vclunohelper
.hxx>
using
namespace
::
cppu
;
using
namespace
::
com
::
sun
::
star
::
awt
;
...
...
@@ -157,12 +157,6 @@ void SAL_CALL StatusbarController::release() throw ()
void
SAL_CALL
StatusbarController
::
initialize
(
const
Sequence
<
Any
>&
aArguments
)
throw
(
Exception
,
RuntimeException
)
{
const
rtl
::
OUString
aFrameName
(
RTL_CONSTASCII_USTRINGPARAM
(
"Frame"
));
const
rtl
::
OUString
aCommandURLName
(
RTL_CONSTASCII_USTRINGPARAM
(
"CommandURL"
));
const
rtl
::
OUString
aServiceManagerName
(
RTL_CONSTASCII_USTRINGPARAM
(
"ServiceManager"
));
const
rtl
::
OUString
aParentWindow
(
RTL_CONSTASCII_USTRINGPARAM
(
"ParentWindow"
));
const
rtl
::
OUString
aIdentifier
(
RTL_CONSTASCII_USTRINGPARAM
(
"Identifier"
));
bool
bInitialized
(
true
);
{
...
...
@@ -184,16 +178,18 @@ throw ( Exception, RuntimeException )
{
if
(
aArguments
[
i
]
>>=
aPropValue
)
{
if
(
aPropValue
.
Name
.
equalsAscii
(
"Frame"
))
if
(
aPropValue
.
Name
.
equalsAscii
L
(
RTL_CONSTASCII_STRINGPARAM
(
"Frame"
)
))
aPropValue
.
Value
>>=
m_xFrame
;
else
if
(
aPropValue
.
Name
.
equalsAscii
(
"CommandURL"
))
else
if
(
aPropValue
.
Name
.
equalsAscii
L
(
RTL_CONSTASCII_STRINGPARAM
(
"CommandURL"
)
))
aPropValue
.
Value
>>=
m_aCommandURL
;
else
if
(
aPropValue
.
Name
.
equalsAscii
(
"ServiceManager"
))
else
if
(
aPropValue
.
Name
.
equalsAscii
L
(
RTL_CONSTASCII_STRINGPARAM
(
"ServiceManager"
)
))
aPropValue
.
Value
>>=
m_xServiceManager
;
else
if
(
aPropValue
.
Name
.
equalsAscii
(
"ParentWindow"
))
else
if
(
aPropValue
.
Name
.
equalsAscii
L
(
RTL_CONSTASCII_STRINGPARAM
(
"ParentWindow"
)
))
aPropValue
.
Value
>>=
m_xParentWindow
;
else
if
(
aPropValue
.
Name
.
equalsAscii
(
"Identifier"
))
else
if
(
aPropValue
.
Name
.
equalsAscii
L
(
RTL_CONSTASCII_STRINGPARAM
(
"Identifier"
)
))
aPropValue
.
Value
>>=
m_nID
;
else
if
(
aPropValue
.
Name
.
equalsAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"StatusbarItem"
)))
aPropValue
.
Value
>>=
m_xStatusbarItem
;
}
}
...
...
@@ -261,6 +257,7 @@ throw (::com::sun::star::uno::RuntimeException)
m_xServiceManager
.
clear
();
m_xFrame
.
clear
();
m_xParentWindow
.
clear
();
m_xStatusbarItem
.
clear
();
m_bDisposed
=
sal_True
;
}
...
...
@@ -281,26 +278,31 @@ throw ( RuntimeException )
void
SAL_CALL
StatusbarController
::
disposing
(
const
EventObject
&
Source
)
throw
(
RuntimeException
)
{
Reference
<
XInterface
>
xSource
(
Source
.
Source
);
vos
::
OGuard
aSolarMutexGuard
(
Application
::
GetSolarMutex
()
);
if
(
m_bDisposed
)
return
;
Reference
<
XFrame
>
xFrame
(
Source
.
Source
,
UNO_QUERY
);
if
(
xFrame
.
is
()
)
{
if
(
xFrame
==
m_xFrame
)
m_xFrame
.
clear
();
return
;
}
Reference
<
XDispatch
>
xDispatch
(
Source
.
Source
,
UNO_QUERY
);
if
(
!
xDispatch
.
is
()
)
return
;
URLToDispatchMap
::
iterator
pIter
=
m_aListenerMap
.
begin
();
while
(
pIter
!=
m_aListenerMap
.
end
()
)
{
// Compare references and release dispatch references if they are equal.
Reference
<
XInterface
>
xIfac
(
pIter
->
second
,
UNO_QUERY
);
if
(
xSource
==
xIfac
)
if
(
xDispatch
==
pIter
->
second
)
pIter
->
second
.
clear
();
pIter
++
;
}
Reference
<
XInterface
>
xIfac
(
m_xFrame
,
UNO_QUERY
);
if
(
xIfac
==
xSource
)
m_xFrame
.
clear
();
}
// XStatusListener
...
...
@@ -359,18 +361,17 @@ throw (::com::sun::star::uno::RuntimeException)
void
SAL_CALL
StatusbarController
::
paint
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XGraphics
>&
,
const
::
com
::
sun
::
star
::
awt
::
Rectangle
&
,
::
sal_Int32
,
::
sal_Int32
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
}
void
SAL_CALL
StatusbarController
::
click
()
void
SAL_CALL
StatusbarController
::
click
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
}
void
SAL_CALL
StatusbarController
::
doubleClick
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
void
SAL_CALL
StatusbarController
::
doubleClick
(
const
::
com
::
sun
::
star
::
awt
::
Point
&
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
vos
::
OGuard
aSolarMutexGuard
(
Application
::
GetSolarMutex
()
);
...
...
@@ -533,37 +534,29 @@ void StatusbarController::bindListener()
}
// Call without locked mutex as we are called back from dispatch implementation
if
(
xStatusListener
.
is
()
)
if
(
!
xStatusListener
.
is
()
)
return
;
for
(
sal_uInt32
i
=
0
;
i
<
aDispatchVector
.
size
();
i
++
)
{
try
{
for
(
sal_uInt32
i
=
0
;
i
<
aDispatchVector
.
size
();
i
++
)
Listener
&
rListener
=
aDispatchVector
[
i
];
if
(
rListener
.
xDispatch
.
is
()
)
rListener
.
xDispatch
->
addStatusListener
(
xStatusListener
,
rListener
.
aURL
);
else
if
(
rListener
.
aURL
.
Complete
==
m_aCommandURL
)
{
Listener
&
rListener
=
aDispatchVector
[
i
];
if
(
rListener
.
xDispatch
.
is
()
)
rListener
.
xDispatch
->
addStatusListener
(
xStatusListener
,
rListener
.
aURL
);
else
if
(
rListener
.
aURL
.
Complete
==
m_aCommandURL
)
{
try
{
// Send status changed for the main URL, if we cannot get a valid dispatch object.
// UI disables the button. Catch exception as we release our mutex, it is possible
// that someone else already disposed this instance!
FeatureStateEvent
aFeatureStateEvent
;
aFeatureStateEvent
.
IsEnabled
=
sal_False
;
aFeatureStateEvent
.
FeatureURL
=
rListener
.
aURL
;
aFeatureStateEvent
.
State
=
Any
();
xStatusListener
->
statusChanged
(
aFeatureStateEvent
);
}
catch
(
Exception
&
)
{
}
}
// Send status changed for the main URL, if we cannot get a valid dispatch object.
// UI disables the button. Catch exception as we release our mutex, it is possible
// that someone else already disposed this instance!
FeatureStateEvent
aFeatureStateEvent
;
aFeatureStateEvent
.
IsEnabled
=
sal_False
;
aFeatureStateEvent
.
FeatureURL
=
rListener
.
aURL
;
aFeatureStateEvent
.
State
=
Any
();
xStatusListener
->
statusChanged
(
aFeatureStateEvent
);
}
}
catch
(
Exception
&
)
{
}
catch
(
...
){}
}
}
...
...
@@ -574,35 +567,30 @@ void StatusbarController::unbindListener()
if
(
!
m_bInitialized
)
return
;
// Collect all registered command URL's and store them temporary
Reference
<
XDispatchProvider
>
xDispatchProvider
(
m_xFrame
,
UNO_QUERY
);
if
(
m_xServiceManager
.
is
()
&&
xDispatchProvider
.
is
()
)
Reference
<
XStatusListener
>
xStatusListener
(
static_cast
<
OWeakObject
*
>
(
this
),
UNO_QUERY
);
URLToDispatchMap
::
iterator
pIter
=
m_aListenerMap
.
begin
(
);
while
(
pIter
!=
m_aListenerMap
.
end
()
)
{
Reference
<
XStatusListener
>
xStatusListener
(
static_cast
<
OWeakObject
*
>
(
this
),
UNO_QUERY
);
URLToDispatchMap
::
iterator
pIter
=
m_aListenerMap
.
begin
();
while
(
pIter
!=
m_aListenerMap
.
end
()
)
{
Reference
<
XURLTransformer
>
xURLTransformer
=
getURLTransformer
();
com
::
sun
::
star
::
util
::
URL
aTargetURL
;
aTargetURL
.
Complete
=
pIter
->
first
;
xURLTransformer
->
parseStrict
(
aTargetURL
);
Reference
<
XURLTransformer
>
xURLTransformer
=
getURLTransformer
();
com
::
sun
::
star
::
util
::
URL
aTargetURL
;
aTargetURL
.
Complete
=
pIter
->
first
;
xURLTransformer
->
parseStrict
(
aTargetURL
);
Reference
<
XDispatch
>
xDispatch
(
pIter
->
second
);
if
(
xDispatch
.
is
()
)
Reference
<
XDispatch
>
xDispatch
(
pIter
->
second
);
if
(
xDispatch
.
is
()
)
{
// We already have a dispatch object => we have to requery.
// Release old dispatch object and remove it as listener
try
{
xDispatch
->
removeStatusListener
(
xStatusListener
,
aTargetURL
);
}
catch
(
Exception
&
)
{
// We already have a dispatch object => we have to requery.
// Release old dispatch object and remove it as listener
try
{
xDispatch
->
removeStatusListener
(
xStatusListener
,
aTargetURL
);
}
catch
(
Exception
&
)
{
}
}
pIter
->
second
.
clear
();
++
pIter
;
}
pIter
->
second
.
clear
();
++
pIter
;
}
}
...
...
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