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
bf84823f
Kaydet (Commit)
bf84823f
authored
Tem 27, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert SFX_CFG* constants to scoped enum
Change-Id: I7b4769d0616b5685792630bcb82fd0d944505a24
üst
7d6d18e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
29 deletions
+32
-29
cfgutil.cxx
cui/source/customize/cfgutil.cxx
+21
-21
cfgutil.hxx
cui/source/inc/cfgutil.hxx
+11
-8
No files found.
cui/source/customize/cfgutil.cxx
Dosyayı görüntüle @
bf84823f
...
@@ -294,13 +294,13 @@ void SfxConfigFunctionListBox::ClearAll()
...
@@ -294,13 +294,13 @@ void SfxConfigFunctionListBox::ClearAll()
{
{
SfxGroupInfo_Impl
*
pData
=
&
aArr
[
i
];
SfxGroupInfo_Impl
*
pData
=
&
aArr
[
i
];
if
(
pData
->
nKind
==
S
FX_CFG
FUNCTION_SCRIPT
)
if
(
pData
->
nKind
==
S
fxCfgKind
::
FUNCTION_SCRIPT
)
{
{
OUString
*
pScriptURI
=
static_cast
<
OUString
*>
(
pData
->
pObject
);
OUString
*
pScriptURI
=
static_cast
<
OUString
*>
(
pData
->
pObject
);
delete
pScriptURI
;
delete
pScriptURI
;
}
}
if
(
pData
->
nKind
==
S
FX_CFG
GROUP_SCRIPTCONTAINER
)
if
(
pData
->
nKind
==
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
)
{
{
XInterface
*
xi
=
static_cast
<
XInterface
*>
(
pData
->
pObject
);
XInterface
*
xi
=
static_cast
<
XInterface
*>
(
pData
->
pObject
);
if
(
xi
!=
NULL
)
if
(
xi
!=
NULL
)
...
@@ -320,7 +320,7 @@ OUString SfxConfigFunctionListBox::GetSelectedScriptURI()
...
@@ -320,7 +320,7 @@ OUString SfxConfigFunctionListBox::GetSelectedScriptURI()
if
(
pEntry
)
if
(
pEntry
)
{
{
SfxGroupInfo_Impl
*
pData
=
static_cast
<
SfxGroupInfo_Impl
*>
(
pEntry
->
GetUserData
());
SfxGroupInfo_Impl
*
pData
=
static_cast
<
SfxGroupInfo_Impl
*>
(
pEntry
->
GetUserData
());
if
(
pData
&&
(
pData
->
nKind
==
S
FX_CFG
FUNCTION_SCRIPT
)
)
if
(
pData
&&
(
pData
->
nKind
==
S
fxCfgKind
::
FUNCTION_SCRIPT
)
)
return
*
static_cast
<
OUString
*>
(
pData
->
pObject
);
return
*
static_cast
<
OUString
*>
(
pData
->
pObject
);
}
}
return
OUString
();
return
OUString
();
...
@@ -428,7 +428,7 @@ void SfxConfigGroupListBox::ClearAll()
...
@@ -428,7 +428,7 @@ void SfxConfigGroupListBox::ClearAll()
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
{
{
SfxGroupInfo_Impl
*
pData
=
&
aArr
[
i
];
SfxGroupInfo_Impl
*
pData
=
&
aArr
[
i
];
if
(
pData
->
nKind
==
S
FX_CFG
GROUP_SCRIPTCONTAINER
)
if
(
pData
->
nKind
==
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
)
{
{
XInterface
*
xi
=
static_cast
<
XInterface
*>
(
pData
->
pObject
);
XInterface
*
xi
=
static_cast
<
XInterface
*>
(
pData
->
pObject
);
if
(
xi
!=
NULL
)
if
(
xi
!=
NULL
)
...
@@ -473,7 +473,7 @@ void SfxConfigGroupListBox::InitModule()
...
@@ -473,7 +473,7 @@ void SfxConfigGroupListBox::InitModule()
{
continue
;
}
{
continue
;
}
SvTreeListEntry
*
pEntry
=
InsertEntry
(
sGroupName
,
NULL
);
SvTreeListEntry
*
pEntry
=
InsertEntry
(
sGroupName
,
NULL
);
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_FUNCTION
,
rGroupID
);
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_FUNCTION
,
rGroupID
);
pEntry
->
SetUserData
(
pInfo
);
pEntry
->
SetUserData
(
pInfo
);
}
}
}
}
...
@@ -584,7 +584,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
...
@@ -584,7 +584,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
rootNode
->
acquire
();
rootNode
->
acquire
();
SfxGroupInfo_Impl
*
pInfo
=
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_SCRIPTCONTAINER
,
0
,
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
,
0
,
static_cast
<
void
*>
(
rootNode
.
get
()));
static_cast
<
void
*>
(
rootNode
.
get
()));
OUString
aTitle
(
pImp
->
m_sDlgMacros
);
OUString
aTitle
(
pImp
->
m_sDlgMacros
);
...
@@ -655,7 +655,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
...
@@ -655,7 +655,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
theChild
->
acquire
();
theChild
->
acquire
();
SfxGroupInfo_Impl
*
pInfo
=
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_SCRIPTCONTAINER
,
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
,
0
,
static_cast
<
void
*>
(
theChild
.
get
()));
0
,
static_cast
<
void
*>
(
theChild
.
get
()));
Image
aImage
=
GetImage
(
theChild
,
xCtx
,
bIsRootNode
);
Image
aImage
=
GetImage
(
theChild
,
xCtx
,
bIsRootNode
);
...
@@ -696,7 +696,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
...
@@ -696,7 +696,7 @@ void SfxConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
{
{
OUString
sStyle
(
pImp
->
m_aStrGroupStyles
);
OUString
sStyle
(
pImp
->
m_aStrGroupStyles
);
SvTreeListEntry
*
pEntry
=
InsertEntry
(
sStyle
,
0
);
SvTreeListEntry
*
pEntry
=
InsertEntry
(
sStyle
,
0
);
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_STYLES
,
0
,
0
);
// TODO last parameter should contain user data
SfxGroupInfo_Impl
*
pInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_STYLES
,
0
,
0
);
// TODO last parameter should contain user data
aArr
.
push_back
(
pInfo
);
aArr
.
push_back
(
pInfo
);
pEntry
->
SetUserData
(
pInfo
);
pEntry
->
SetUserData
(
pInfo
);
pEntry
->
EnableChildrenOnDemand
(
true
);
pEntry
->
EnableChildrenOnDemand
(
true
);
...
@@ -837,9 +837,9 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -837,9 +837,9 @@ void SfxConfigGroupListBox::GroupSelected()
SfxGroupInfo_Impl
*
pInfo
=
static_cast
<
SfxGroupInfo_Impl
*>
(
pEntry
->
GetUserData
());
SfxGroupInfo_Impl
*
pInfo
=
static_cast
<
SfxGroupInfo_Impl
*>
(
pEntry
->
GetUserData
());
pFunctionListBox
->
SetUpdateMode
(
false
);
pFunctionListBox
->
SetUpdateMode
(
false
);
pFunctionListBox
->
ClearAll
();
pFunctionListBox
->
ClearAll
();
if
(
pInfo
->
nKind
!=
S
FX_CFG
GROUP_FUNCTION
&&
if
(
pInfo
->
nKind
!=
S
fxCfgKind
::
GROUP_FUNCTION
&&
pInfo
->
nKind
!=
S
FX_CFG
GROUP_SCRIPTCONTAINER
&&
pInfo
->
nKind
!=
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
&&
pInfo
->
nKind
!=
S
FX_CFG
GROUP_STYLES
)
pInfo
->
nKind
!=
S
fxCfgKind
::
GROUP_STYLES
)
{
{
pFunctionListBox
->
SetUpdateMode
(
true
);
pFunctionListBox
->
SetUpdateMode
(
true
);
return
;
return
;
...
@@ -847,7 +847,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -847,7 +847,7 @@ void SfxConfigGroupListBox::GroupSelected()
switch
(
pInfo
->
nKind
)
switch
(
pInfo
->
nKind
)
{
{
case
S
FX_CFG
GROUP_FUNCTION
:
case
S
fxCfgKind
:
:
GROUP_FUNCTION
:
{
{
sal_uInt16
nGroup
=
pInfo
->
nUniqueID
;
sal_uInt16
nGroup
=
pInfo
->
nUniqueID
;
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchInformationProvider
>
xProvider
(
m_xFrame
,
css
::
uno
::
UNO_QUERY_THROW
);
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchInformationProvider
>
xProvider
(
m_xFrame
,
css
::
uno
::
UNO_QUERY_THROW
);
...
@@ -860,7 +860,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -860,7 +860,7 @@ void SfxConfigGroupListBox::GroupSelected()
const
css
::
frame
::
DispatchInformation
&
rInfo
=
lCommands
[
i
];
const
css
::
frame
::
DispatchInformation
&
rInfo
=
lCommands
[
i
];
OUString
sUIName
=
MapCommand2UIName
(
rInfo
.
Command
);
OUString
sUIName
=
MapCommand2UIName
(
rInfo
.
Command
);
SvTreeListEntry
*
pFuncEntry
=
pFunctionListBox
->
InsertEntry
(
sUIName
,
NULL
);
SvTreeListEntry
*
pFuncEntry
=
pFunctionListBox
->
InsertEntry
(
sUIName
,
NULL
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
FUNCTION_SLOT
,
0
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
FUNCTION_SLOT
,
0
);
pGrpInfo
->
sCommand
=
rInfo
.
Command
;
pGrpInfo
->
sCommand
=
rInfo
.
Command
;
pGrpInfo
->
sLabel
=
sUIName
;
pGrpInfo
->
sLabel
=
sUIName
;
pFuncEntry
->
SetUserData
(
pGrpInfo
);
pFuncEntry
->
SetUserData
(
pGrpInfo
);
...
@@ -869,7 +869,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -869,7 +869,7 @@ void SfxConfigGroupListBox::GroupSelected()
break
;
break
;
}
}
case
S
FX_CFG
GROUP_SCRIPTCONTAINER
:
case
S
fxCfgKind
:
:
GROUP_SCRIPTCONTAINER
:
{
{
if
(
!
GetChildCount
(
pEntry
)
)
if
(
!
GetChildCount
(
pEntry
)
)
{
{
...
@@ -899,7 +899,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -899,7 +899,7 @@ void SfxConfigGroupListBox::GroupSelected()
value
>>=
uri
;
value
>>=
uri
;
OUString
*
pScriptURI
=
new
OUString
(
uri
);
OUString
*
pScriptURI
=
new
OUString
(
uri
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
FUNCTION_SCRIPT
,
0
,
pScriptURI
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
FUNCTION_SCRIPT
,
0
,
pScriptURI
);
Image
aImage
=
GetImage
(
children
[
n
],
Reference
<
XComponentContext
>
(),
false
);
Image
aImage
=
GetImage
(
children
[
n
],
Reference
<
XComponentContext
>
(),
false
);
SvTreeListEntry
*
pNewEntry
=
SvTreeListEntry
*
pNewEntry
=
...
@@ -924,7 +924,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -924,7 +924,7 @@ void SfxConfigGroupListBox::GroupSelected()
break
;
break
;
}
}
case
S
FX_CFG
GROUP_STYLES
:
case
S
fxCfgKind
:
:
GROUP_STYLES
:
{
{
SfxStyleInfo_Impl
*
pFamily
=
static_cast
<
SfxStyleInfo_Impl
*>
(
pInfo
->
pObject
);
SfxStyleInfo_Impl
*
pFamily
=
static_cast
<
SfxStyleInfo_Impl
*>
(
pInfo
->
pObject
);
if
(
pFamily
)
if
(
pFamily
)
...
@@ -937,7 +937,7 @@ void SfxConfigGroupListBox::GroupSelected()
...
@@ -937,7 +937,7 @@ void SfxConfigGroupListBox::GroupSelected()
{
{
SfxStyleInfo_Impl
*
pStyle
=
new
SfxStyleInfo_Impl
(
*
pIt
);
SfxStyleInfo_Impl
*
pStyle
=
new
SfxStyleInfo_Impl
(
*
pIt
);
SvTreeListEntry
*
pFuncEntry
=
pFunctionListBox
->
InsertEntry
(
pStyle
->
sLabel
,
NULL
);
SvTreeListEntry
*
pFuncEntry
=
pFunctionListBox
->
InsertEntry
(
pStyle
->
sLabel
,
NULL
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_STYLES
,
0
,
pStyle
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_STYLES
,
0
,
pStyle
);
pFunctionListBox
->
aArr
.
push_back
(
pGrpInfo
);
pFunctionListBox
->
aArr
.
push_back
(
pGrpInfo
);
pGrpInfo
->
sCommand
=
pStyle
->
sCommand
;
pGrpInfo
->
sCommand
=
pStyle
->
sCommand
;
pGrpInfo
->
sLabel
=
pStyle
->
sLabel
;
pGrpInfo
->
sLabel
=
pStyle
->
sLabel
;
...
@@ -997,7 +997,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
...
@@ -997,7 +997,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
pInfo
->
bWasOpened
=
true
;
pInfo
->
bWasOpened
=
true
;
switch
(
pInfo
->
nKind
)
switch
(
pInfo
->
nKind
)
{
{
case
S
FX_CFG
GROUP_SCRIPTCONTAINER
:
case
S
fxCfgKind
:
:
GROUP_SCRIPTCONTAINER
:
{
{
if
(
!
GetChildCount
(
pEntry
)
)
if
(
!
GetChildCount
(
pEntry
)
)
{
{
...
@@ -1052,7 +1052,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
...
@@ -1052,7 +1052,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
theChild
->
acquire
();
theChild
->
acquire
();
SfxGroupInfo_Impl
*
pGrpInfo
=
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_SCRIPTCONTAINER
,
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_SCRIPTCONTAINER
,
0
,
static_cast
<
void
*>
(
theChild
.
get
()));
0
,
static_cast
<
void
*>
(
theChild
.
get
()));
Image
aImage
=
GetImage
(
theChild
,
Reference
<
XComponentContext
>
(),
false
);
Image
aImage
=
GetImage
(
theChild
,
Reference
<
XComponentContext
>
(),
false
);
...
@@ -1089,7 +1089,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
...
@@ -1089,7 +1089,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
break
;
break
;
}
}
case
S
FX_CFG
GROUP_STYLES
:
case
S
fxCfgKind
:
:
GROUP_STYLES
:
{
{
if
(
!
GetChildCount
(
pEntry
)
)
if
(
!
GetChildCount
(
pEntry
)
)
{
{
...
@@ -1101,7 +1101,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
...
@@ -1101,7 +1101,7 @@ void SfxConfigGroupListBox::RequestingChildren( SvTreeListEntry *pEntry )
{
{
SfxStyleInfo_Impl
*
pFamily
=
new
SfxStyleInfo_Impl
(
*
pIt
);
SfxStyleInfo_Impl
*
pFamily
=
new
SfxStyleInfo_Impl
(
*
pIt
);
SvTreeListEntry
*
pStyleEntry
=
InsertEntry
(
pFamily
->
sLabel
,
pEntry
);
SvTreeListEntry
*
pStyleEntry
=
InsertEntry
(
pFamily
->
sLabel
,
pEntry
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
FX_CFG
GROUP_STYLES
,
0
,
pFamily
);
SfxGroupInfo_Impl
*
pGrpInfo
=
new
SfxGroupInfo_Impl
(
S
fxCfgKind
::
GROUP_STYLES
,
0
,
pFamily
);
aArr
.
push_back
(
pGrpInfo
);
aArr
.
push_back
(
pGrpInfo
);
pStyleEntry
->
SetUserData
(
pGrpInfo
);
pStyleEntry
->
SetUserData
(
pGrpInfo
);
pStyleEntry
->
EnableChildrenOnDemand
(
false
);
pStyleEntry
->
EnableChildrenOnDemand
(
false
);
...
...
cui/source/inc/cfgutil.hxx
Dosyayı görüntüle @
bf84823f
...
@@ -74,22 +74,25 @@ struct SfxStylesInfo_Impl
...
@@ -74,22 +74,25 @@ struct SfxStylesInfo_Impl
static
OUString
generateCommand
(
const
OUString
&
sFamily
,
const
OUString
&
sStyle
);
static
OUString
generateCommand
(
const
OUString
&
sFamily
,
const
OUString
&
sStyle
);
};
};
#define SFX_CFGGROUP_FUNCTION 1
enum
class
SfxCfgKind
#define SFX_CFGFUNCTION_SLOT 2
{
#define SFX_CFGGROUP_SCRIPTCONTAINER 3
GROUP_FUNCTION
=
1
,
#define SFX_CFGFUNCTION_SCRIPT 4
FUNCTION_SLOT
=
2
,
#define SFX_CFGGROUP_STYLES 5
GROUP_SCRIPTCONTAINER
=
3
,
FUNCTION_SCRIPT
=
4
,
GROUP_STYLES
=
5
,
};
struct
SfxGroupInfo_Impl
struct
SfxGroupInfo_Impl
{
{
sal_uInt16
nKind
;
SfxCfgKind
nKind
;
sal_uInt16
nUniqueID
;
sal_uInt16
nUniqueID
;
void
*
pObject
;
void
*
pObject
;
bool
bWasOpened
;
bool
bWasOpened
;
OUString
sCommand
;
OUString
sCommand
;
OUString
sLabel
;
OUString
sLabel
;
SfxGroupInfo_Impl
(
sal_uInt16
n
,
sal_uInt16
nr
,
void
*
pObj
=
0
)
:
SfxGroupInfo_Impl
(
SfxCfgKind
n
,
sal_uInt16
nr
,
void
*
pObj
=
0
)
:
nKind
(
n
),
nUniqueID
(
nr
),
pObject
(
pObj
),
bWasOpened
(
false
)
{}
nKind
(
n
),
nUniqueID
(
nr
),
pObject
(
pObj
),
bWasOpened
(
false
)
{}
};
};
...
...
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