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
394895de
Kaydet (Commit)
394895de
authored
Ock 14, 2016
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use a map for dispatch
Change-Id: I29c88c834a01f8d04a2998ea3edfa95cd0cadb85
üst
ec5e17c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
65 deletions
+40
-65
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+40
-65
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
394895de
...
@@ -1812,72 +1812,47 @@ void SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>(const SfxItemPropertySimpleE
...
@@ -1812,72 +1812,47 @@ void SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>(const SfxItemPropertySimpleE
void
SwXStyle
::
SetStyleProperty
(
const
SfxItemPropertySimpleEntry
&
rEntry
,
const
SfxItemPropertySet
&
rPropSet
,
const
uno
::
Any
&
rValue
,
SwStyleBase_Impl
&
rBase
)
throw
(
beans
::
PropertyVetoException
,
lang
::
IllegalArgumentException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
void
SwXStyle
::
SetStyleProperty
(
const
SfxItemPropertySimpleEntry
&
rEntry
,
const
SfxItemPropertySet
&
rPropSet
,
const
uno
::
Any
&
rValue
,
SwStyleBase_Impl
&
rBase
)
throw
(
beans
::
PropertyVetoException
,
lang
::
IllegalArgumentException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
{
switch
(
rEntry
.
nWID
)
using
propertytype_t
=
decltype
(
rEntry
.
nWID
);
using
coresetter_t
=
std
::
function
<
void
(
SwXStyle
&
,
const
SfxItemPropertySimpleEntry
&
,
const
SfxItemPropertySet
&
,
const
uno
::
Any
&
,
SwStyleBase_Impl
&
)
>
;
static
std
::
unique_ptr
<
std
::
map
<
propertytype_t
,
coresetter_t
>>
pUnoToCore
;
if
(
!
pUnoToCore
)
{
{
case
FN_UNO_HIDDEN
:
pUnoToCore
.
reset
(
new
std
::
map
<
propertytype_t
,
coresetter_t
>
{
SetPropertyValue
<
FN_UNO_HIDDEN
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
// these explicit std::mem_fn() calls shouldnt be needed, but apparently MSVC is currently too stupid for C++11 again
break
;
{
FN_UNO_HIDDEN
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_HIDDEN
>
)
},
case
FN_UNO_STYLE_INTEROP_GRAB_BAG
:
{
FN_UNO_STYLE_INTEROP_GRAB_BAG
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_STYLE_INTEROP_GRAB_BAG
>
)
},
SetPropertyValue
<
FN_UNO_STYLE_INTEROP_GRAB_BAG
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
XATTR_FILLGRADIENT
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
XATTR_FILLGRADIENT
>
)
},
break
;
{
XATTR_FILLHATCH
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
XATTR_FILLGRADIENT
>
)
},
case
XATTR_FILLGRADIENT
:
{
XATTR_FILLBITMAP
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
XATTR_FILLGRADIENT
>
)
},
case
XATTR_FILLHATCH
:
{
XATTR_FILLFLOATTRANSPARENCE
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
XATTR_FILLGRADIENT
>
)
},
case
XATTR_FILLBITMAP
:
{
RES_BACKGROUND
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_BACKGROUND
>
)
},
case
XATTR_FILLFLOATTRANSPARENCE
:
{
OWN_ATTR_FILLBMP_MODE
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
OWN_ATTR_FILLBMP_MODE
>
)
},
SetPropertyValue
<
XATTR_FILLGRADIENT
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
RES_PAPER_BIN
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PAPER_BIN
>
)
},
break
;
{
FN_UNO_NUM_RULES
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_NUM_RULES
>
)
},
case
RES_BACKGROUND
:
{
RES_PARATR_OUTLINELEVEL
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PARATR_OUTLINELEVEL
>
)
},
SetPropertyValue
<
RES_BACKGROUND
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
FN_UNO_FOLLOW_STYLE
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_FOLLOW_STYLE
>
)
},
break
;
{
RES_PAGEDESC
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PAGEDESC
>
)
},
case
OWN_ATTR_FILLBMP_MODE
:
{
RES_TEXT_VERT_ADJUST
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_TEXT_VERT_ADJUST
>
)
},
SetPropertyValue
<
OWN_ATTR_FILLBMP_MODE
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
FN_UNO_IS_AUTO_UPDATE
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_IS_AUTO_UPDATE
>
)
},
break
;
{
FN_UNO_PARA_STYLE_CONDITIONS
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_PARA_STYLE_CONDITIONS
>
)
},
case
RES_PAPER_BIN
:
{
FN_UNO_CATEGORY
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
FN_UNO_CATEGORY
>
)
},
SetPropertyValue
<
RES_PAPER_BIN
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
SID_SWREGISTER_COLLECTION
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
SID_SWREGISTER_COLLECTION
>
)
},
break
;
{
RES_TXTATR_CJK_RUBY
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_TXTATR_CJK_RUBY
>
)
},
case
FN_UNO_NUM_RULES
:
// special handling for a SvxNumRuleItem:
{
RES_PARATR_DROP
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PARATR_DROP
>
)
},
SetPropertyValue
<
FN_UNO_NUM_RULES
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
{
RES_PARATR_DROP
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PARATR_DROP
>
)
},
break
;
{
RES_PARATR_NUMRULE
,
std
::
mem_fn
(
&
SwXStyle
::
SetPropertyValue
<
RES_PARATR_NUMRULE
>
)
}
case
RES_PARATR_OUTLINELEVEL
:
});
SetPropertyValue
<
RES_PARATR_OUTLINELEVEL
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
}
break
;
const
auto
pUnoToCoreIt
(
pUnoToCore
->
find
(
rEntry
.
nWID
));
case
FN_UNO_FOLLOW_STYLE
:
if
(
pUnoToCoreIt
!=
pUnoToCore
->
end
())
SetPropertyValue
<
FN_UNO_FOLLOW_STYLE
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
pUnoToCoreIt
->
second
(
*
this
,
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
else
case
RES_PAGEDESC
:
{
SetPropertyValue
<
RES_PAGEDESC
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
//UUUU adapted switch logic to a more readable state; removed goto's and made
break
;
// execution of standard setting of proerty in ItemSet dependent of this variable
case
RES_TEXT_VERT_ADJUST
:
uno
::
Any
aValue
(
rValue
);
SetPropertyValue
<
RES_TEXT_VERT_ADJUST
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
lcl_TranslateMetric
(
rEntry
,
m_pDoc
,
aValue
);
break
;
lcl_SetDefaultWay
(
rEntry
,
rPropSet
,
aValue
,
rBase
);
case
FN_UNO_IS_AUTO_UPDATE
:
SetPropertyValue
<
FN_UNO_IS_AUTO_UPDATE
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
FN_UNO_PARA_STYLE_CONDITIONS
:
SetPropertyValue
<
FN_UNO_PARA_STYLE_CONDITIONS
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
FN_UNO_CATEGORY
:
SetPropertyValue
<
FN_UNO_CATEGORY
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
SID_SWREGISTER_COLLECTION
:
SetPropertyValue
<
SID_SWREGISTER_COLLECTION
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
RES_TXTATR_CJK_RUBY
:
SetPropertyValue
<
RES_TXTATR_CJK_RUBY
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
RES_PARATR_DROP
:
SetPropertyValue
<
RES_PARATR_DROP
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
case
RES_PARATR_NUMRULE
:
SetPropertyValue
<
RES_PARATR_NUMRULE
>
(
rEntry
,
rPropSet
,
rValue
,
rBase
);
break
;
default
:
//UUUU adapted switch logic to a more readable state; removed goto's and made
// execution of standard setting of proerty in ItemSet dependent of this variable
uno
::
Any
aValue
(
rValue
);
lcl_TranslateMetric
(
rEntry
,
m_pDoc
,
aValue
);
lcl_SetDefaultWay
(
rEntry
,
rPropSet
,
aValue
,
rBase
);
break
;
}
}
}
}
...
...
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