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
6182554f
Kaydet (Commit)
6182554f
authored
Ock 02, 2016
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor out to limit scope: RES_PAGEDESC
Change-Id: Id5c83f8dcc19dc5e94a895f1e15bc5dc8e800d9f
üst
d632f641
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
48 deletions
+39
-48
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+39
-48
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
6182554f
...
@@ -1616,7 +1616,43 @@ void SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySimple
...
@@ -1616,7 +1616,43 @@ void SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySimple
SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId, true);
SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId, true);
o_rStyleBase.getNewBase()->SetFollow(aString);
o_rStyleBase.getNewBase()->SetFollow(aString);
}
}
template<>
void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
{
if(MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId)
{
lcl_SetDefaultWay(rEntry, rPropSet, rValue, o_rStyleBase);
return;
}
if(!rValue.has<OUString>())
throw lang::IllegalArgumentException();
// special handling for RES_PAGEDESC
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
std::unique_ptr<SwFormatPageDesc> pNewDesc;
const SfxPoolItem* pItem;
if(SfxItemState::SET == rStyleSet.GetItemState(RES_PAGEDESC, true, &pItem))
pNewDesc.reset(new SwFormatPageDesc(*static_cast<const SwFormatPageDesc*>(pItem)));
else
pNewDesc.reset(new SwFormatPageDesc);
const auto sValue(rValue.get<OUString>());
OUString sDescName;
SwStyleNameMapper::FillUIName(sValue, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true);
if(pNewDesc->GetPageDesc() && pNewDesc->GetPageDesc()->GetName() == sDescName)
return;
if(sDescName.isEmpty())
{
rStyleSet.ClearItem(RES_BREAK);
rStyleSet.Put(SwFormatPageDesc());
}
else
{
SwPageDesc* pPageDesc(SwPageDesc::GetByName(*m_pDoc, sDescName));
if(!pPageDesc)
throw lang::IllegalArgumentException();
pNewDesc->RegisterToPageDesc(*pPageDesc);
rStyleSet.Put(*pNewDesc);
}
}
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)
{
{
...
@@ -1670,55 +1706,10 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const
...
@@ -1670,55 +1706,10 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const
SetPropertyValue<FN_UNO_FOLLOW_STYLE>(rEntry, rPropSet, rValue, rBase);
SetPropertyValue<FN_UNO_FOLLOW_STYLE>(rEntry, rPropSet, rValue, rBase);
bDone = true;
bDone = true;
break;
break;
case
RES_PAGEDESC
:
case RES_PAGEDESC:
{
SetPropertyValue<RES_PAGEDESC>(rEntry, rPropSet, rValue, rBase);
if
(
MID_PAGEDESC_PAGEDESCNAME
!=
nMemberId
)
break
;
// special handling for RES_PAGEDESC
if
(
aValue
.
getValueType
()
!=
::
cppu
::
UnoType
<
OUString
>::
get
())
throw
lang
::
IllegalArgumentException
();
SfxItemSet
&
rStyleSet
=
rBase
.
GetItemSet
();
std
::
unique_ptr
<
SwFormatPageDesc
>
pNewDesc
;
const
SfxPoolItem
*
pItem
;
if
(
SfxItemState
::
SET
==
rStyleSet
.
GetItemState
(
RES_PAGEDESC
,
true
,
&
pItem
)
)
{
pNewDesc
.
reset
(
new
SwFormatPageDesc
(
*
static_cast
<
const
SwFormatPageDesc
*>
(
pItem
))
);
}
else
pNewDesc
.
reset
(
new
SwFormatPageDesc
);
OUString
uDescName
;
aValue
>>=
uDescName
;
OUString
sDescName
;
SwStyleNameMapper
::
FillUIName
(
uDescName
,
sDescName
,
nsSwGetPoolIdFromName
::
GET_POOLID_PAGEDESC
,
true
);
if
(
!
pNewDesc
->
GetPageDesc
()
||
pNewDesc
->
GetPageDesc
()
->
GetName
()
!=
sDescName
)
{
bool
bPut
=
false
;
if
(
!
sDescName
.
isEmpty
())
{
SwPageDesc
*
pPageDesc
=
SwPageDesc
::
GetByName
(
*
pDoc
,
sDescName
);
if
(
pPageDesc
)
{
pNewDesc
->
RegisterToPageDesc
(
*
pPageDesc
);
bPut
=
true
;
}
else
{
throw
lang
::
IllegalArgumentException
();
}
}
if
(
!
bPut
)
{
rStyleSet
.
ClearItem
(
RES_BREAK
);
rStyleSet
.
Put
(
SwFormatPageDesc
());
}
else
rStyleSet
.
Put
(
*
pNewDesc
);
}
bDone = true;
bDone = true;
break;
break;
}
case RES_TEXT_VERT_ADJUST:
case RES_TEXT_VERT_ADJUST:
{
{
if( pDoc )
if( pDoc )
...
...
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