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
0c48c809
Kaydet (Commit)
0c48c809
authored
Kas 17, 2015
tarafından
Samuel Mehrbrodt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#95845 Use CommandInfoProvider to receive command properties
Change-Id: I41f9a661b7a5b355e50910d7f58f0d9d55dc62a6
üst
16f85dc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
55 deletions
+24
-55
toolbarmanager.cxx
framework/source/uielement/toolbarmanager.cxx
+1
-55
commandinfoprovider.hxx
include/vcl/commandinfoprovider.hxx
+4
-0
commandinfoprovider.cxx
vcl/source/helper/commandinfoprovider.cxx
+19
-0
No files found.
framework/source/uielement/toolbarmanager.cxx
Dosyayı görüntüle @
0c48c809
...
@@ -773,62 +773,8 @@ void ToolBarManager::RemoveControllers()
...
@@ -773,62 +773,8 @@ void ToolBarManager::RemoveControllers()
m_aControllerMap
.
clear
();
m_aControllerMap
.
clear
();
}
}
uno
::
Sequence
<
beans
::
PropertyValue
>
ToolBarManager
::
GetPropsForCommand
(
const
OUString
&
rCmdURL
)
{
Sequence
<
PropertyValue
>
aPropSeq
;
// Retrieve properties for command
try
{
if
(
!
m_bModuleIdentified
)
{
Reference
<
XModuleManager2
>
xModuleManager
=
ModuleManager
::
create
(
m_xContext
);
Reference
<
XInterface
>
xIfac
(
m_xFrame
,
UNO_QUERY
);
m_bModuleIdentified
=
true
;
m_aModuleIdentifier
=
xModuleManager
->
identify
(
xIfac
);
if
(
!
m_aModuleIdentifier
.
isEmpty
()
)
{
Reference
<
XNameAccess
>
xNameAccess
=
frame
::
theUICommandDescription
::
get
(
m_xContext
);
xNameAccess
->
getByName
(
m_aModuleIdentifier
)
>>=
m_xUICommandLabels
;
}
}
if
(
m_xUICommandLabels
.
is
()
)
{
if
(
!
rCmdURL
.
isEmpty
()
)
m_xUICommandLabels
->
getByName
(
rCmdURL
)
>>=
aPropSeq
;
}
}
catch
(
const
Exception
&
)
{
}
return
aPropSeq
;
}
sal_Int32
ToolBarManager
::
RetrievePropertiesFromCommand
(
const
OUString
&
aCmdURL
)
{
sal_Int32
nProperties
(
0
);
Sequence
<
PropertyValue
>
aPropSeq
;
// Retrieve popup menu labels
aPropSeq
=
GetPropsForCommand
(
aCmdURL
);
for
(
sal_Int32
i
=
0
;
i
<
aPropSeq
.
getLength
();
i
++
)
{
if
(
aPropSeq
[
i
].
Name
==
"Properties"
)
{
aPropSeq
[
i
].
Value
>>=
nProperties
;
break
;
}
}
return
nProperties
;
}
void
ToolBarManager
::
CreateControllers
()
void
ToolBarManager
::
CreateControllers
()
{
{
Reference
<
XWindow
>
xToolbarWindow
=
VCLUnoHelper
::
GetInterface
(
m_pToolBar
);
Reference
<
XWindow
>
xToolbarWindow
=
VCLUnoHelper
::
GetInterface
(
m_pToolBar
);
css
::
util
::
URL
aURL
;
css
::
util
::
URL
aURL
;
...
@@ -932,7 +878,7 @@ void ToolBarManager::CreateControllers()
...
@@ -932,7 +878,7 @@ void ToolBarManager::CreateControllers()
new
GenericToolbarController
(
m_xContext
,
m_xFrame
,
m_pToolBar
,
nId
,
aCommandURL
));
new
GenericToolbarController
(
m_xContext
,
m_xFrame
,
m_pToolBar
,
nId
,
aCommandURL
));
// Accessibility support: Set toggle button role for specific commands
// Accessibility support: Set toggle button role for specific commands
sal_Int32
nProps
=
RetrievePropertiesFromCommand
(
aCommandURL
);
sal_Int32
nProps
=
vcl
::
CommandInfoProvider
::
Instance
().
GetPropertiesForCommand
(
aCommandURL
,
m_xFrame
);
if
(
nProps
&
UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON
)
if
(
nProps
&
UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON
)
m_pToolBar
->
SetItemBits
(
nId
,
m_pToolBar
->
GetItemBits
(
nId
)
|
ToolBoxItemBits
::
CHECKABLE
);
m_pToolBar
->
SetItemBits
(
nId
,
m_pToolBar
->
GetItemBits
(
nId
)
|
ToolBoxItemBits
::
CHECKABLE
);
}
}
...
...
include/vcl/commandinfoprovider.hxx
Dosyayı görüntüle @
0c48c809
...
@@ -84,6 +84,10 @@ public:
...
@@ -84,6 +84,10 @@ public:
bool
bLarge
,
bool
bLarge
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
sal_Int32
GetPropertiesForCommand
(
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
/** Do not call. Should be part of a local and hidden interface.
/** Do not call. Should be part of a local and hidden interface.
*/
*/
void
SetFrame
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
void
SetFrame
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
...
...
vcl/source/helper/commandinfoprovider.cxx
Dosyayı görüntüle @
0c48c809
...
@@ -214,6 +214,25 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName, boo
...
@@ -214,6 +214,25 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName, boo
return
Image
();
return
Image
();
}
}
sal_Int32
CommandInfoProvider
::
GetPropertiesForCommand
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
SetFrame
(
rxFrame
);
const
Sequence
<
beans
::
PropertyValue
>
aProperties
(
GetCommandProperties
(
rsCommandName
));
for
(
sal_Int32
nIndex
=
0
;
nIndex
<
aProperties
.
getLength
();
++
nIndex
)
{
if
(
aProperties
[
nIndex
].
Name
==
"Properties"
)
{
sal_Int32
nValue
;
aProperties
[
nIndex
].
Value
>>=
nValue
;
return
nValue
;
}
}
return
0
;
}
void
CommandInfoProvider
::
SetFrame
(
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
void
CommandInfoProvider
::
SetFrame
(
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
{
if
(
rxFrame
!=
mxCachedDataFrame
)
if
(
rxFrame
!=
mxCachedDataFrame
)
...
...
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