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
0729e946
Kaydet (Commit)
0729e946
authored
Kas 28, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
clean up and reduce indent levels
Change-Id: If35b67439eee347d15a55e965756466db1cb466c
üst
8f57b3f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
56 deletions
+35
-56
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+35
-56
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
0729e946
...
...
@@ -644,66 +644,45 @@ void SwXStyleFamily::insertByName(const OUString& rName, const uno::Any& rElemen
throw
(
lang
::
IllegalArgumentException
,
container
::
ElementExistException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
if
(
m_pBasePool
)
if
(
!
m_pBasePool
)
throw
uno
::
RuntimeException
();
OUString
sStyleName
;
SwStyleNameMapper
::
FillUIName
(
rName
,
sStyleName
,
lcl_GetSwEnumFromSfxEnum
(
m_eFamily
),
true
);
m_pBasePool
->
SetSearchMask
(
m_eFamily
);
SfxStyleSheetBase
*
pBase
=
m_pBasePool
->
Find
(
sStyleName
);
SfxStyleSheetBase
*
pUINameBase
=
m_pBasePool
->
Find
(
sStyleName
);
if
(
pBase
||
pUINameBase
)
throw
container
::
ElementExistException
();
if
(
rElement
.
getValueType
().
getTypeClass
()
!=
uno
::
TypeClass_INTERFACE
)
throw
lang
::
IllegalArgumentException
();
uno
::
Reference
<
lang
::
XUnoTunnel
>
xStyleTunnel
=
rElement
.
get
<
uno
::
Reference
<
lang
::
XUnoTunnel
>>
();
SwXStyle
*
pNewStyle
=
nullptr
;
if
(
xStyleTunnel
.
is
())
{
OUString
sStyleName
;
SwStyleNameMapper
::
FillUIName
(
rName
,
sStyleName
,
lcl_GetSwEnumFromSfxEnum
(
m_eFamily
),
true
);
m_pBasePool
->
SetSearchMask
(
m_eFamily
);
SfxStyleSheetBase
*
pBase
=
m_pBasePool
->
Find
(
sStyleName
);
SfxStyleSheetBase
*
pUINameBase
=
m_pBasePool
->
Find
(
sStyleName
);
if
(
pBase
||
pUINameBase
)
throw
container
::
ElementExistException
();
else
{
if
(
rElement
.
getValueType
().
getTypeClass
()
==
uno
::
TypeClass_INTERFACE
)
{
uno
::
Reference
<
uno
::
XInterface
>
const
*
pxRef
=
static_cast
<
uno
::
Reference
<
uno
::
XInterface
>
const
*>
(
rElement
.
getValue
());
uno
::
Reference
<
lang
::
XUnoTunnel
>
xStyleTunnel
(
*
pxRef
,
uno
::
UNO_QUERY
);
SwXStyle
*
pNewStyle
=
nullptr
;
if
(
xStyleTunnel
.
is
())
{
pNewStyle
=
reinterpret_cast
<
SwXStyle
*
>
(
sal
::
static_int_cast
<
sal_IntPtr
>
(
xStyleTunnel
->
getSomething
(
SwXStyle
::
getUnoTunnelId
())
));
}
if
(
!
pNewStyle
||
!
pNewStyle
->
IsDescriptor
()
||
pNewStyle
->
GetFamily
()
!=
m_eFamily
)
throw
lang
::
IllegalArgumentException
();
pNewStyle
=
reinterpret_cast
<
SwXStyle
*
>
(
sal
::
static_int_cast
<
sal_IntPtr
>
(
xStyleTunnel
->
getSomething
(
SwXStyle
::
getUnoTunnelId
())
));
}
sal_uInt16
nMask
=
SFXSTYLEBIT_ALL
;
if
(
m_eFamily
==
SFX_STYLE_FAMILY_PARA
&&
!
pNewStyle
->
IsConditional
())
nMask
&=
~
SWSTYLEBIT_CONDCOLL
;
#if OSL_DEBUG_LEVEL > 1
SfxStyleSheetBase
&
rNewBase
=
#endif
m_pBasePool
->
Make
(
sStyleName
,
m_eFamily
,
nMask
);
pNewStyle
->
SetDoc
(
m_pDocShell
->
GetDoc
(),
m_pBasePool
);
pNewStyle
->
SetStyleName
(
sStyleName
);
const
OUString
sParentStyleName
(
pNewStyle
->
GetParentStyleName
());
if
(
!
sParentStyleName
.
isEmpty
())
{
m_pBasePool
->
SetSearchMask
(
m_eFamily
);
SfxStyleSheetBase
*
pParentBase
=
m_pBasePool
->
Find
(
sParentStyleName
);
if
(
pParentBase
&&
pParentBase
->
GetFamily
()
==
m_eFamily
&&
&
pParentBase
->
GetPool
()
==
m_pBasePool
)
m_pBasePool
->
SetParent
(
m_eFamily
,
sStyleName
,
sParentStyleName
);
if
(
!
pNewStyle
||
!
pNewStyle
->
IsDescriptor
()
||
pNewStyle
->
GetFamily
()
!=
m_eFamily
)
throw
lang
::
IllegalArgumentException
();
}
#if OSL_DEBUG_LEVEL > 1
(
void
)
rNewBase
;
#endif
// after all, we still need to apply the properties of the descriptor
pNewStyle
->
ApplyDescriptorProperties
();
}
else
throw
lang
::
IllegalArgumentException
();
}
sal_uInt16
nMask
=
SFXSTYLEBIT_ALL
;
if
(
m_eFamily
==
SFX_STYLE_FAMILY_PARA
&&
!
pNewStyle
->
IsConditional
())
nMask
&=
~
SWSTYLEBIT_CONDCOLL
;
m_pBasePool
->
Make
(
sStyleName
,
m_eFamily
,
nMask
);
pNewStyle
->
SetDoc
(
m_pDocShell
->
GetDoc
(),
m_pBasePool
);
pNewStyle
->
SetStyleName
(
sStyleName
);
const
OUString
sParentStyleName
(
pNewStyle
->
GetParentStyleName
());
if
(
!
sParentStyleName
.
isEmpty
())
{
m_pBasePool
->
SetSearchMask
(
m_eFamily
);
SfxStyleSheetBase
*
pParentBase
=
m_pBasePool
->
Find
(
sParentStyleName
);
if
(
pParentBase
&&
pParentBase
->
GetFamily
()
==
m_eFamily
&&
&
pParentBase
->
GetPool
()
==
m_pBasePool
)
m_pBasePool
->
SetParent
(
m_eFamily
,
sStyleName
,
sParentStyleName
);
}
else
throw
uno
::
RuntimeException
();
// after all, we still need to apply the properties of the descriptor
pNewStyle
->
ApplyDescriptorProperties
();
}
void
SwXStyleFamily
::
replaceByName
(
const
OUString
&
rName
,
const
uno
::
Any
&
rElement
)
...
...
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