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
0ae13c77
Kaydet (Commit)
0ae13c77
authored
Eyl 20, 2017
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmloff,sw: some stylistic cleanup to conditional styles
Change-Id: I1722a0b3d67a7c8740daa5a131d7800319ee2373
üst
2c7ec52b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
38 deletions
+42
-38
xmlfmt.cxx
sw/source/filter/xml/xmlfmt.cxx
+22
-18
ccoll.cxx
sw/source/uibase/chrdlg/ccoll.cxx
+2
-0
prstylecond.cxx
xmloff/source/style/prstylecond.cxx
+10
-11
styleexp.cxx
xmloff/source/style/styleexp.cxx
+8
-9
No files found.
sw/source/filter/xml/xmlfmt.cxx
Dosyayı görüntüle @
0ae13c77
...
...
@@ -311,36 +311,40 @@ SwXMLTextStyleContext_Impl::Finish( bool bOverwrite )
if
(
pConditions
&&
XML_STYLE_FAMILY_TEXT_PARAGRAPH
==
GetFamily
()
&&
xNewStyle
.
is
()
)
{
CommandStruct
const
*
a
Commands
=
SwCondCollItem
::
GetCmds
();
CommandStruct
const
*
const
p
Commands
=
SwCondCollItem
::
GetCmds
();
Reference
<
XPropertySet
>
xPropSet
(
xNewStyle
,
UNO_QUERY
);
uno
::
Sequence
<
beans
::
NamedValue
>
aSeq
(
pConditions
->
size
()
);
std
::
vector
<
rtl
::
Reference
<
SwXMLConditionContext_Impl
>>::
size_type
i
;
unsigned
j
;
for
(
i
=
0
;
i
<
pConditions
->
size
();
++
i
)
for
(
std
::
vector
<
rtl
::
Reference
<
SwXMLConditionContext_Impl
>>::
size_type
i
=
0
;
i
<
pConditions
->
size
();
++
i
)
{
if
(
(
*
pConditions
)[
i
]
->
IsValid
()
)
{
Master_CollCondition
nCond
=
(
*
pConditions
)[
i
]
->
getCondition
();
sal_uInt32
nSubCond
=
(
*
pConditions
)[
i
]
->
getSubCondition
();
assert
((
*
pConditions
)[
i
]
->
IsValid
());
// checked before inserting
Master_CollCondition
nCond
=
(
*
pConditions
)[
i
]
->
getCondition
();
sal_uInt32
nSubCond
=
(
*
pConditions
)[
i
]
->
getSubCondition
();
for
(
j
=
0
;
j
<
COND_COMMAND_COUNT
;
++
j
)
for
(
size_t
j
=
0
;
j
<
COND_COMMAND_COUNT
;
++
j
)
{
if
(
pCommands
[
j
].
nCnd
==
nCond
&&
pCommands
[
j
].
nSubCond
==
nSubCond
)
{
if
(
aCommands
[
j
].
nCnd
==
nCond
&&
aCommands
[
j
].
nSubCond
==
nSubCond
)
{
aSeq
[
i
].
Name
=
GetCommandContextByIndex
(
j
);
aSeq
[
i
].
Value
<<=
GetImport
().
GetStyleDisplayName
(
GetFamily
(),
(
*
pConditions
)[
i
]
->
getApplyStyle
()
);
break
;
}
aSeq
[
i
].
Name
=
GetCommandContextByIndex
(
j
);
aSeq
[
i
].
Value
<<=
GetImport
().
GetStyleDisplayName
(
GetFamily
(),
(
*
pConditions
)[
i
]
->
getApplyStyle
()
);
break
;
}
}
}
xPropSet
->
setPropertyValue
(
UNO_NAME_PARA_STYLE_CONDITIONS
,
uno
::
makeAny
(
aSeq
)
);
try
{
xPropSet
->
setPropertyValue
(
UNO_NAME_PARA_STYLE_CONDITIONS
,
uno
::
makeAny
(
aSeq
));
}
catch
(
uno
::
Exception
const
&
e
)
{
SAL_WARN
(
"sw.xml"
,
"exception when setting ParaStyleConditions: "
<<
e
.
Message
);
}
}
XMLTextStyleContext
::
Finish
(
bOverwrite
);
}
...
...
sw/source/uibase/chrdlg/ccoll.cxx
Dosyayı görüntüle @
0ae13c77
...
...
@@ -41,6 +41,8 @@
//!! order of entries has to be the same as in
//!! CommandStruct SwCondCollItem::aCmds[]
// note: also keep this in sync with the list of conditions in xmloff/source/style/prstylecond.cxx
const
char
*
const
aCommandContext
[
COND_COMMAND_COUNT
]
=
{
"TableHeader"
,
...
...
xmloff/source/style/prstylecond.cxx
Dosyayı görüntüle @
0ae13c77
...
...
@@ -23,12 +23,14 @@
using
namespace
::
xmloff
::
token
;
static
struct
ConditionMap
// note: keep this in sync with the list of conditions in sw/source/uibase/chrdlg/ccoll.cxx
static
const
struct
ConditionMap
{
char
const
*
aInternal
;
XMLTokenEnum
nExternal
;
int
aValue
;
}
a
ConditionMap
[]
=
}
g_
ConditionMap
[]
=
{
{
"TableHeader"
,
XML_TABLE_HEADER
,
-
1
},
{
"Table"
,
XML_TABLE
,
-
1
},
...
...
@@ -60,27 +62,24 @@ static struct ConditionMap
{
"NumberingLevel10"
,
XML_LIST_LEVEL
,
10
}
};
#define CONDITION_COUNT (sizeof(aConditionMap) / sizeof(aConditionMap[0]))
OUString
GetParaStyleCondExternal
(
OUString
const
&
internal
)
{
unsigned
i
;
for
(
i
=
0
;
i
<
CONDITION_COUNT
;
++
i
)
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
g_ConditionMap
);
++
i
)
{
if
(
internal
.
compareToAscii
(
a
ConditionMap
[
i
].
aInternal
)
==
0
)
if
(
internal
.
compareToAscii
(
g_
ConditionMap
[
i
].
aInternal
)
==
0
)
{
OUString
aResult
(
GetXMLToken
(
a
ConditionMap
[
i
].
nExternal
)
);
OUString
aResult
(
GetXMLToken
(
g_
ConditionMap
[
i
].
nExternal
)
);
aResult
+=
"()"
;
if
(
aConditionMap
[
i
].
aValue
!=
-
1
)
if
(
g_ConditionMap
[
i
].
aValue
!=
-
1
)
{
aResult
+=
"="
;
aResult
+=
OUString
::
number
(
a
ConditionMap
[
i
].
aValue
);
aResult
+=
OUString
::
number
(
g_
ConditionMap
[
i
].
aValue
);
}
return
aResult
;
}
}
assert
(
!
"GetParaStyleCondExternal: model has unknown style condition"
);
return
OUString
();
}
...
...
xmloff/source/style/styleexp.cxx
Dosyayı görüntüle @
0ae13c77
...
...
@@ -80,30 +80,29 @@ void XMLStyleExport::exportStyleAttributes( const Reference< XStyle >& )
void
XMLStyleExport
::
exportStyleContent
(
const
Reference
<
XStyle
>&
rStyle
)
{
Reference
<
XPropertySet
>
xPropSet
(
rStyle
,
UNO_QUERY
);
assert
(
xPropSet
.
is
());
try
{
uno
::
Any
aProperty
=
xPropSet
->
getPropertyValue
(
"ParaStyleConditions"
);
uno
::
Sequence
<
beans
::
NamedValue
>
aSeq
;
int
i
;
aProperty
>>=
aSeq
;
for
(
i
=
0
;
i
<
aSeq
.
getLength
();
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
aSeq
.
getLength
();
++
i
)
{
beans
::
NamedValue
const
&
a
NamedCond
=
aSeq
[
i
];
beans
::
NamedValue
const
&
r
NamedCond
=
aSeq
[
i
];
OUString
aStyleName
;
if
(
aNamedCond
.
Value
>>=
aStyleName
)
if
(
rNamedCond
.
Value
>>=
aStyleName
)
{
if
(
aStyleName
.
getLength
()
>
0
)
if
(
!
aStyleName
.
isEmpty
()
)
{
OUString
aExternal
=
GetParaStyleCondExternal
(
aNamedCond
.
Name
);
OUString
aExternal
=
GetParaStyleCondExternal
(
rNamedCond
.
Name
);
if
(
aExternal
.
getLength
()
>
0
)
if
(
!
aExternal
.
isEmpty
()
)
{
bool
bEncoded
;
bool
bEncoded
;
GetExport
().
AddAttribute
(
XML_NAMESPACE_STYLE
,
XML_CONDITION
,
...
...
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