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
f72947d5
Kaydet (Commit)
f72947d5
authored
Ock 25, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
writerfilter: whitespace fixes in TablePositionHandler
Change-Id: I0d4a624ee75e701966a2694642d71483c6ec572f
üst
6de362e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
84 deletions
+88
-84
TablePositionHandler.cxx
writerfilter/source/dmapper/TablePositionHandler.cxx
+47
-45
TablePositionHandler.hxx
writerfilter/source/dmapper/TablePositionHandler.hxx
+41
-39
No files found.
writerfilter/source/dmapper/TablePositionHandler.cxx
Dosyayı görüntüle @
f72947d5
...
...
@@ -16,19 +16,21 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include "dmapperLoggers.hxx"
namespace
writerfilter
{
namespace
dmapper
{
namespace
writerfilter
{
namespace
dmapper
{
using
namespace
::
com
::
sun
::
star
;
TablePositionHandler
::
TablePositionHandler
()
:
LoggedProperties
(
dmapper_logger
,
"TablePositionHandler"
),
m_aVertAnchor
(
"margin"
),
m_aYSpec
(
),
m_aHorzAnchor
(
"text"
),
m_aXSpec
(
),
m_nY
(
0
),
m_nX
(
0
),
m_aVertAnchor
(
"margin"
),
m_aYSpec
(),
m_aHorzAnchor
(
"text"
),
m_aXSpec
(),
m_nY
(
0
),
m_nX
(
0
),
m_nLeftFromText
(
0
),
m_nRightFromText
(
0
),
m_nTopFromText
(
0
),
...
...
@@ -45,41 +47,41 @@ void TablePositionHandler::lcl_attribute(Id rName, Value& rVal)
{
switch
(
rName
)
{
case
NS_ooxml
:
:
LN_CT_TblPPr_vertAnchor
:
m_aVertAnchor
=
rVal
.
getString
();
case
NS_ooxml
:
:
LN_CT_TblPPr_vertAnchor
:
m_aVertAnchor
=
rVal
.
getString
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpYSpec
:
m_aYSpec
=
rVal
.
getString
();
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpYSpec
:
m_aYSpec
=
rVal
.
getString
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_horzAnchor
:
m_aHorzAnchor
=
rVal
.
getString
();
case
NS_ooxml
:
:
LN_CT_TblPPr_horzAnchor
:
m_aHorzAnchor
=
rVal
.
getString
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpXSpec
:
m_aXSpec
=
rVal
.
getString
();
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpXSpec
:
m_aXSpec
=
rVal
.
getString
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpY
:
m_nY
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpY
:
m_nY
=
rVal
.
getInt
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpX
:
m_nX
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_tblpX
:
m_nX
=
rVal
.
getInt
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_leftFromText
:
m_nLeftFromText
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_leftFromText
:
m_nLeftFromText
=
rVal
.
getInt
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_rightFromText
:
m_nRightFromText
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_rightFromText
:
m_nRightFromText
=
rVal
.
getInt
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_topFromText
:
m_nTopFromText
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_topFromText
:
m_nTopFromText
=
rVal
.
getInt
();
break
;
case
NS_ooxml
:
:
LN_CT_TblPPr_bottomFromText
:
m_nBottomFromText
=
rVal
.
getInt
();
case
NS_ooxml
:
:
LN_CT_TblPPr_bottomFromText
:
m_nBottomFromText
=
rVal
.
getInt
();
break
;
default
:
default
:
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger
->
element
(
"unhandled"
);
dmapper_logger
->
element
(
"unhandled"
);
#endif
break
;
break
;
}
}
...
...
@@ -124,23 +126,23 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
// Horizontal positioning
sal_Int16
nHoriOrient
=
text
::
HoriOrientation
::
NONE
;
if
(
m_aXSpec
==
"center"
)
if
(
m_aXSpec
==
"center"
)
nHoriOrient
=
text
::
HoriOrientation
::
CENTER
;
else
if
(
m_aXSpec
==
"inside"
)
else
if
(
m_aXSpec
==
"inside"
)
nHoriOrient
=
text
::
HoriOrientation
::
INSIDE
;
else
if
(
m_aXSpec
==
"left"
)
else
if
(
m_aXSpec
==
"left"
)
nHoriOrient
=
text
::
HoriOrientation
::
LEFT
;
else
if
(
m_aXSpec
==
"outside"
)
else
if
(
m_aXSpec
==
"outside"
)
nHoriOrient
=
text
::
HoriOrientation
::
OUTSIDE
;
else
if
(
m_aXSpec
==
"right"
)
else
if
(
m_aXSpec
==
"right"
)
nHoriOrient
=
text
::
HoriOrientation
::
RIGHT
;
sal_Int16
nHoriOrientRelation
;
if
(
m_aHorzAnchor
==
"margin"
)
if
(
m_aHorzAnchor
==
"margin"
)
nHoriOrientRelation
=
text
::
RelOrientation
::
PAGE_PRINT_AREA
;
else
if
(
m_aHorzAnchor
==
"page"
)
else
if
(
m_aHorzAnchor
==
"page"
)
nHoriOrientRelation
=
text
::
RelOrientation
::
PAGE_FRAME
;
else
if
(
m_aHorzAnchor
==
"text"
)
else
if
(
m_aHorzAnchor
==
"text"
)
nHoriOrientRelation
=
text
::
RelOrientation
::
FRAME
;
pFrameProperties
[
12
].
Name
=
"HoriOrient"
;
...
...
@@ -153,21 +155,21 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
// Vertical positioning
sal_Int16
nVertOrient
=
text
::
VertOrientation
::
NONE
;
if
(
m_aYSpec
==
"bottom"
)
if
(
m_aYSpec
==
"bottom"
)
nVertOrient
=
text
::
VertOrientation
::
BOTTOM
;
else
if
(
m_aYSpec
==
"center"
)
else
if
(
m_aYSpec
==
"center"
)
nVertOrient
=
text
::
VertOrientation
::
CENTER
;
else
if
(
m_aYSpec
==
"top"
)
else
if
(
m_aYSpec
==
"top"
)
nVertOrient
=
text
::
VertOrientation
::
TOP
;
// TODO There are a few cases we can't map ATM.
sal_Int16
nVertOrientRelation
;
if
(
m_aVertAnchor
==
"margin"
)
if
(
m_aVertAnchor
==
"margin"
)
nVertOrientRelation
=
text
::
RelOrientation
::
PAGE_PRINT_AREA
;
else
if
(
m_aVertAnchor
==
"page"
)
else
if
(
m_aVertAnchor
==
"page"
)
nVertOrientRelation
=
text
::
RelOrientation
::
PAGE_FRAME
;
else
if
(
m_aVertAnchor
==
"text"
)
else
if
(
m_aVertAnchor
==
"text"
)
nVertOrientRelation
=
text
::
RelOrientation
::
FRAME
;
pFrameProperties
[
15
].
Name
=
"VertOrient"
;
...
...
writerfilter/source/dmapper/TablePositionHandler.hxx
Dosyayı görüntüle @
f72947d5
...
...
@@ -14,45 +14,47 @@
#include <boost/shared_ptr.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
namespace
writerfilter
{
namespace
dmapper
{
/// Handler for floating table positioning
class
WRITERFILTER_DLLPRIVATE
TablePositionHandler
:
public
LoggedProperties
{
OUString
m_aVertAnchor
;
OUString
m_aYSpec
;
OUString
m_aHorzAnchor
;
OUString
m_aXSpec
;
sal_Int32
m_nY
;
sal_Int32
m_nX
;
sal_Int32
m_nLeftFromText
;
sal_Int32
m_nRightFromText
;
sal_Int32
m_nTopFromText
;
sal_Int32
m_nBottomFromText
;
// Properties
virtual
void
lcl_attribute
(
Id
Name
,
Value
&
val
);
virtual
void
lcl_sprm
(
Sprm
&
sprm
);
public
:
TablePositionHandler
();
virtual
~
TablePositionHandler
();
/** Compute the UNO properties for the frame containing the table based
on the received tokens.
Note that the properties will need to be adjusted with the table
properties before actually using them.
*/
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
getTablePosition
()
const
;
bool
operator
==
(
const
TablePositionHandler
&
rHandler
)
const
;
};
typedef
boost
::
shared_ptr
<
TablePositionHandler
>
TablePositionHandlerPtr
;
}
// namespace dmapper
namespace
writerfilter
{
namespace
dmapper
{
/// Handler for floating table positioning
class
WRITERFILTER_DLLPRIVATE
TablePositionHandler
:
public
LoggedProperties
{
OUString
m_aVertAnchor
;
OUString
m_aYSpec
;
OUString
m_aHorzAnchor
;
OUString
m_aXSpec
;
sal_Int32
m_nY
;
sal_Int32
m_nX
;
sal_Int32
m_nLeftFromText
;
sal_Int32
m_nRightFromText
;
sal_Int32
m_nTopFromText
;
sal_Int32
m_nBottomFromText
;
// Properties
virtual
void
lcl_attribute
(
Id
Name
,
Value
&
val
);
virtual
void
lcl_sprm
(
Sprm
&
sprm
);
public
:
TablePositionHandler
();
virtual
~
TablePositionHandler
();
/** Compute the UNO properties for the frame containing the table based
on the received tokens.
Note that the properties will need to be adjusted with the table
properties before actually using them.
*/
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
getTablePosition
()
const
;
bool
operator
==
(
const
TablePositionHandler
&
rHandler
)
const
;
};
typedef
boost
::
shared_ptr
<
TablePositionHandler
>
TablePositionHandlerPtr
;
}
// namespace dmapper
}
// namespace writerfilter
#endif
...
...
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