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
0af2e9fa
Kaydet (Commit)
0af2e9fa
authored
Tem 30, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
writerfilter: manual memory management -> boost::optional in PropertyMap
Change-Id: Ie8f7ce11ab03d47835cfe224c775324dd79a5e7a
üst
780dd8c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
PropertyMap.cxx
writerfilter/source/dmapper/PropertyMap.cxx
+7
-11
PropertyMap.hxx
writerfilter/source/dmapper/PropertyMap.hxx
+2
-1
No files found.
writerfilter/source/dmapper/PropertyMap.cxx
Dosyayı görüntüle @
0af2e9fa
...
@@ -432,7 +432,6 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
...
@@ -432,7 +432,6 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
{
{
static
sal_Int32
nNumber
=
0
;
static
sal_Int32
nNumber
=
0
;
nSectionNumber
=
nNumber
++
;
nSectionNumber
=
nNumber
++
;
memset
(
&
m_pBorderLines
,
0x00
,
sizeof
(
m_pBorderLines
));
for
(
sal_Int32
nBorder
=
0
;
nBorder
<
4
;
++
nBorder
)
for
(
sal_Int32
nBorder
=
0
;
nBorder
<
4
;
++
nBorder
)
{
{
m_nBorderDistances
[
nBorder
]
=
-
1
;
m_nBorderDistances
[
nBorder
]
=
-
1
;
...
@@ -471,8 +470,6 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
...
@@ -471,8 +470,6 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
SectionPropertyMap
::~
SectionPropertyMap
()
SectionPropertyMap
::~
SectionPropertyMap
()
{
{
for
(
sal_Int16
ePos
=
BORDER_LEFT
;
ePos
<=
BORDER_BOTTOM
;
++
ePos
)
delete
m_pBorderLines
[
ePos
];
}
}
...
@@ -564,8 +561,7 @@ uno::Reference< beans::XPropertySet > SectionPropertyMap::GetPageStyle(
...
@@ -564,8 +561,7 @@ uno::Reference< beans::XPropertySet > SectionPropertyMap::GetPageStyle(
void
SectionPropertyMap
::
SetBorder
(
BorderPosition
ePos
,
sal_Int32
nLineDistance
,
const
table
::
BorderLine2
&
rBorderLine
,
bool
bShadow
)
void
SectionPropertyMap
::
SetBorder
(
BorderPosition
ePos
,
sal_Int32
nLineDistance
,
const
table
::
BorderLine2
&
rBorderLine
,
bool
bShadow
)
{
{
delete
m_pBorderLines
[
ePos
];
m_oBorderLines
[
ePos
]
=
rBorderLine
;
m_pBorderLines
[
ePos
]
=
new
table
::
BorderLine2
(
rBorderLine
);
m_nBorderDistances
[
ePos
]
=
nLineDistance
;
m_nBorderDistances
[
ePos
]
=
nLineDistance
;
m_bBorderShadows
[
ePos
]
=
bShadow
;
m_bBorderShadows
[
ePos
]
=
bShadow
;
}
}
...
@@ -639,19 +635,19 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
...
@@ -639,19 +635,19 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
for
(
sal_Int32
nBorder
=
0
;
nBorder
<
4
;
++
nBorder
)
for
(
sal_Int32
nBorder
=
0
;
nBorder
<
4
;
++
nBorder
)
{
{
if
(
m_
p
BorderLines
[
nBorder
]
)
if
(
m_
o
BorderLines
[
nBorder
]
)
{
{
const
OUString
sBorderName
=
getPropertyName
(
aBorderIds
[
nBorder
]
);
const
OUString
sBorderName
=
getPropertyName
(
aBorderIds
[
nBorder
]
);
if
(
xFirst
.
is
())
if
(
xFirst
.
is
())
xFirst
->
setPropertyValue
(
sBorderName
,
uno
::
makeAny
(
*
m_
p
BorderLines
[
nBorder
]
));
xFirst
->
setPropertyValue
(
sBorderName
,
uno
::
makeAny
(
*
m_
o
BorderLines
[
nBorder
]
));
if
(
xSecond
.
is
())
if
(
xSecond
.
is
())
xSecond
->
setPropertyValue
(
sBorderName
,
uno
::
makeAny
(
*
m_
p
BorderLines
[
nBorder
]
));
xSecond
->
setPropertyValue
(
sBorderName
,
uno
::
makeAny
(
*
m_
o
BorderLines
[
nBorder
]
));
}
}
if
(
m_nBorderDistances
[
nBorder
]
>=
0
)
if
(
m_nBorderDistances
[
nBorder
]
>=
0
)
{
{
sal_uInt32
nLineWidth
=
0
;
sal_uInt32
nLineWidth
=
0
;
if
(
m_
p
BorderLines
[
nBorder
])
if
(
m_
o
BorderLines
[
nBorder
])
nLineWidth
=
m_
p
BorderLines
[
nBorder
]
->
LineWidth
;
nLineWidth
=
m_
o
BorderLines
[
nBorder
]
->
LineWidth
;
if
(
xFirst
.
is
())
if
(
xFirst
.
is
())
SetBorderDistance
(
xFirst
,
aMarginIds
[
nBorder
],
aBorderDistanceIds
[
nBorder
],
SetBorderDistance
(
xFirst
,
aMarginIds
[
nBorder
],
aBorderDistanceIds
[
nBorder
],
m_nBorderDistances
[
nBorder
],
nOffsetFrom
,
nLineWidth
);
m_nBorderDistances
[
nBorder
],
nOffsetFrom
,
nLineWidth
);
...
@@ -663,7 +659,7 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
...
@@ -663,7 +659,7 @@ void SectionPropertyMap::ApplyBorderToPageStyles(
if
(
m_bBorderShadows
[
BORDER_RIGHT
])
if
(
m_bBorderShadows
[
BORDER_RIGHT
])
{
{
table
::
ShadowFormat
aFormat
=
getShadowFromBorder
(
*
m_
p
BorderLines
[
BORDER_RIGHT
]);
table
::
ShadowFormat
aFormat
=
getShadowFromBorder
(
*
m_
o
BorderLines
[
BORDER_RIGHT
]);
if
(
xFirst
.
is
())
if
(
xFirst
.
is
())
xFirst
->
setPropertyValue
(
getPropertyName
(
PROP_SHADOW_FORMAT
),
uno
::
makeAny
(
aFormat
));
xFirst
->
setPropertyValue
(
getPropertyName
(
PROP_SHADOW_FORMAT
),
uno
::
makeAny
(
aFormat
));
if
(
xSecond
.
is
())
if
(
xSecond
.
is
())
...
...
writerfilter/source/dmapper/PropertyMap.hxx
Dosyayı görüntüle @
0af2e9fa
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Any.h>
#include "PropertyIds.hxx"
#include "PropertyIds.hxx"
#include <memory>
#include <memory>
...
@@ -190,7 +191,7 @@ class SectionPropertyMap : public PropertyMap
...
@@ -190,7 +191,7 @@ class SectionPropertyMap : public PropertyMap
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_aFirstPageStyle
;
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_aFirstPageStyle
;
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_aFollowPageStyle
;
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_aFollowPageStyle
;
css
::
table
::
BorderLine2
*
m_p
BorderLines
[
4
];
boost
::
optional
<
css
::
table
::
BorderLine2
>
m_o
BorderLines
[
4
];
sal_Int32
m_nBorderDistances
[
4
];
sal_Int32
m_nBorderDistances
[
4
];
sal_Int32
m_nBorderParams
;
sal_Int32
m_nBorderParams
;
bool
m_bBorderShadows
[
4
];
bool
m_bBorderShadows
[
4
];
...
...
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