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
edc4861a
Kaydet (Commit)
edc4861a
authored
Agu 15, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
n#775899 initial docx import of w:vertAnchor inside w:tblpPr
Change-Id: I5c848a8d4c860a83d6729b8db40f744afad906d5
üst
25ef6ea6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
191 additions
and
1 deletion
+191
-1
Library_writerfilter.mk
writerfilter/Library_writerfilter.mk
+1
-0
DomainMapperTableHandler.cxx
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+64
-1
DomainMapperTableManager.cxx
writerfilter/source/dmapper/DomainMapperTableManager.cxx
+18
-0
DomainMapperTableManager.hxx
writerfilter/source/dmapper/DomainMapperTableManager.hxx
+2
-0
TablePositionHandler.cxx
writerfilter/source/dmapper/TablePositionHandler.cxx
+61
-0
TablePositionHandler.hxx
writerfilter/source/dmapper/TablePositionHandler.hxx
+42
-0
model.xml
writerfilter/source/ooxml/model.xml
+3
-0
No files found.
writerfilter/Library_writerfilter.mk
Dosyayı görüntüle @
edc4861a
...
...
@@ -122,6 +122,7 @@ $(eval $(call gb_Library_add_exception_objects,writerfilter,\
writerfilter/source/dmapper/SettingsTable \
writerfilter/source/dmapper/StyleSheetTable \
writerfilter/source/dmapper/TDefTableHandler \
writerfilter/source/dmapper/TablePositionHandler \
writerfilter/source/dmapper/TablePropertiesHandler \
writerfilter/source/dmapper/TblStylePrHandler \
writerfilter/source/dmapper/ThemeTable \
...
...
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
Dosyayı görüntüle @
edc4861a
...
...
@@ -23,6 +23,7 @@
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <dmapperLoggers.hxx>
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
...
...
@@ -691,11 +692,24 @@ void DomainMapperTableHandler::endTable()
if
(
m_pTableSeq
->
getLength
()
>
0
)
{
uno
::
Reference
<
text
::
XTextRange
>
xStart
;
uno
::
Reference
<
text
::
XTextRange
>
xEnd
;
// If we want to make this table a floating one.
bool
bFloating
=
!
m_rDMapper_Impl
.
getTableManager
().
getTableVertAnchor
().
isEmpty
();
// Additional checks: if we can do this.
if
(
bFloating
&&
(
*
m_pTableSeq
)[
0
].
getLength
()
>
0
&&
(
*
m_pTableSeq
)[
0
][
0
].
getLength
()
>
0
)
{
xStart
=
(
*
m_pTableSeq
)[
0
][
0
][
0
];
uno
::
Sequence
<
uno
::
Sequence
<
uno
::
Reference
<
text
::
XTextRange
>
>
>&
rLastRow
=
(
*
m_pTableSeq
)[
m_pTableSeq
->
getLength
()
-
1
];
uno
::
Sequence
<
uno
::
Reference
<
text
::
XTextRange
>
>&
rLastCell
=
rLastRow
[
rLastRow
.
getLength
()
-
1
];
xEnd
=
rLastCell
[
1
];
}
uno
::
Reference
<
text
::
XTextTable
>
xTable
;
try
{
if
(
m_xText
.
is
())
{
uno
::
Reference
<
text
::
XTextTable
>
xTable
=
m_xText
->
convertToTable
(
*
m_pTableSeq
,
xTable
=
m_xText
->
convertToTable
(
*
m_pTableSeq
,
aCellProperties
,
aRowProperties
,
aTableInfo
.
aTableProperties
);
...
...
@@ -723,6 +737,55 @@ void DomainMapperTableHandler::endTable()
(
void
)
e
;
#endif
}
// If we have a table with a start and an end position, we should make it a floating one.
if
(
xTable
.
is
()
&&
xStart
.
is
()
&&
xEnd
.
is
())
{
uno
::
Reference
<
beans
::
XPropertySet
>
xTableProperties
(
xTable
,
uno
::
UNO_QUERY
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aFrameProperties
(
16
);
beans
::
PropertyValue
*
pFrameProperties
=
aFrameProperties
.
getArray
();
pFrameProperties
[
0
].
Name
=
"Width"
;
pFrameProperties
[
0
].
Value
=
xTableProperties
->
getPropertyValue
(
"Width"
);
pFrameProperties
[
1
].
Name
=
"LeftBorderDistance"
;
pFrameProperties
[
1
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
2
].
Name
=
"RightBorderDistance"
;
pFrameProperties
[
2
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
3
].
Name
=
"TopBorderDistance"
;
pFrameProperties
[
3
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
4
].
Name
=
"BottomBorderDistance"
;
pFrameProperties
[
4
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
5
].
Name
=
"LeftMargin"
;
pFrameProperties
[
5
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
6
].
Name
=
"RightMargin"
;
pFrameProperties
[
6
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
7
].
Name
=
"TopMargin"
;
pFrameProperties
[
7
].
Value
<<=
sal_Int32
(
0
);
pFrameProperties
[
8
].
Name
=
"BottomMargin"
;
pFrameProperties
[
8
].
Value
<<=
sal_Int32
(
0
);
table
::
BorderLine2
aEmptyBorder
;
pFrameProperties
[
9
].
Name
=
"TopBorder"
;
pFrameProperties
[
9
].
Value
<<=
aEmptyBorder
;
pFrameProperties
[
10
].
Name
=
"BottomBorder"
;
pFrameProperties
[
10
].
Value
<<=
aEmptyBorder
;
pFrameProperties
[
11
].
Name
=
"LeftBorder"
;
pFrameProperties
[
11
].
Value
<<=
aEmptyBorder
;
pFrameProperties
[
12
].
Name
=
"RightBorder"
;
pFrameProperties
[
12
].
Value
<<=
aEmptyBorder
;
pFrameProperties
[
13
].
Name
=
"HoriOrient"
;
pFrameProperties
[
13
].
Value
<<=
text
::
HoriOrientation
::
NONE
;
pFrameProperties
[
14
].
Name
=
"HoriOrientRelation"
;
pFrameProperties
[
14
].
Value
<<=
text
::
RelOrientation
::
FRAME
;
// A non-zero left margin would move the table out of the frame, move the frame itself instead.
pFrameProperties
[
15
].
Name
=
"HoriOrientPosition"
;
pFrameProperties
[
15
].
Value
<<=
xTableProperties
->
getPropertyValue
(
"LeftMargin"
);
xTableProperties
->
setPropertyValue
(
"LeftMargin"
,
uno
::
makeAny
(
sal_Int32
(
0
)));
uno
::
Reference
<
text
::
XTextContent
>
xFrame
=
m_xText
->
convertToTextFrame
(
xStart
,
xEnd
,
aFrameProperties
);
}
}
m_aTableProperties
.
reset
();
...
...
writerfilter/source/dmapper/DomainMapperTableManager.cxx
Dosyayı görüntüle @
edc4861a
...
...
@@ -23,6 +23,7 @@
#include <CellMarginHandler.hxx>
#include <ConversionHelper.hxx>
#include <MeasureHandler.hxx>
#include <TablePositionHandler.hxx>
#include <TDefTableHandler.hxx>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
...
...
@@ -297,6 +298,17 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
cellProps
(
pProps
);
}
break
;
case
NS_ooxml
:
:
LN_CT_TblPrBase_tblpPr
:
{
writerfilter
::
Reference
<
Properties
>::
Pointer_t
pProperties
=
rSprm
.
getProps
();
if
(
pProperties
.
get
())
{
TablePositionHandlerPtr
pHandler
(
new
TablePositionHandler
);
pProperties
->
resolve
(
*
pHandler
);
m_sTableVertAnchor
=
pHandler
->
getVertAnchor
();
}
}
break
;
default
:
bRet
=
false
;
...
...
@@ -318,6 +330,11 @@ boost::shared_ptr< vector< sal_Int32 > > DomainMapperTableManager::getCurrentSpa
return
m_aGridSpans
.
back
(
);
}
const
OUString
&
DomainMapperTableManager
::
getTableVertAnchor
()
const
{
return
m_sTableVertAnchor
;
}
void
DomainMapperTableManager
::
startLevel
(
)
{
DomainMapperTableManager_Base_t
::
startLevel
(
);
...
...
@@ -512,6 +529,7 @@ void DomainMapperTableManager::clearData()
{
m_nRow
=
m_nCell
=
m_nCellBorderIndex
=
m_nHeaderRepeat
=
m_nTableWidth
=
0
;
m_sTableStyleName
=
OUString
();
m_sTableVertAnchor
=
OUString
();
m_pTableStyleTextProperies
.
reset
();
}
...
...
writerfilter/source/dmapper/DomainMapperTableManager.hxx
Dosyayı görüntüle @
edc4861a
...
...
@@ -43,6 +43,7 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
bool
m_bOOXML
;
bool
m_bImplicitMerges
;
OUString
m_sTableStyleName
;
OUString
m_sTableVertAnchor
;
PropertyMapPtr
m_pTableStyleTextProperies
;
::
std
::
vector
<
IntVectorPtr
>
m_aTableGrid
;
...
...
@@ -74,6 +75,7 @@ public:
IntVectorPtr
getCurrentSpans
(
);
const
OUString
&
getTableStyleName
()
const
{
return
m_sTableStyleName
;
}
const
OUString
&
getTableVertAnchor
()
const
;
/// copy the text properties of the table style and its parent into pContext
void
CopyTextProperties
(
PropertyMapPtr
pContext
,
StyleSheetTablePtr
pStyleSheetTable
);
...
...
writerfilter/source/dmapper/TablePositionHandler.cxx
0 → 100644
Dosyayı görüntüle @
edc4861a
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <TablePositionHandler.hxx>
#include <PropertyMap.hxx>
#include <doctok/resourceids.hxx>
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
#include <com/sun/star/text/SizeType.hpp>
#include "dmapperLoggers.hxx"
namespace
writerfilter
{
namespace
dmapper
{
using
namespace
::
com
::
sun
::
star
;
TablePositionHandler
::
TablePositionHandler
()
:
LoggedProperties
(
dmapper_logger
,
"TablePositionHandler"
)
{
}
TablePositionHandler
::~
TablePositionHandler
()
{
}
void
TablePositionHandler
::
lcl_attribute
(
Id
rName
,
Value
&
rVal
)
{
switch
(
rName
)
{
case
NS_ooxml
:
:
LN_CT_TblPPr_vertAnchor
:
m_aVertAnchor
=
rVal
.
getString
();
break
;
default
:
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger
->
element
(
"unhandled"
);
#endif
break
;
}
}
void
TablePositionHandler
::
lcl_sprm
(
Sprm
&
/*rSprm*/
)
{
}
OUString
TablePositionHandler
::
getVertAnchor
()
const
{
return
m_aVertAnchor
;
}
}
// namespace dmapper
}
// namespace writerfilter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
writerfilter/source/dmapper/TablePositionHandler.hxx
0 → 100644
Dosyayı görüntüle @
edc4861a
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_POSITIONHANDLER_HXX
#define INCLUDED_POSITIONHANDLER_HXX
#include <WriterFilterDllApi.hxx>
#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace
writerfilter
{
namespace
dmapper
{
/// Handler for floating table positioning
class
WRITERFILTER_DLLPRIVATE
TablePositionHandler
:
public
LoggedProperties
{
OUString
m_aVertAnchor
;
// Properties
virtual
void
lcl_attribute
(
Id
Name
,
Value
&
val
);
virtual
void
lcl_sprm
(
Sprm
&
sprm
);
public
:
TablePositionHandler
();
virtual
~
TablePositionHandler
();
OUString
getVertAnchor
()
const
;
};
typedef
boost
::
shared_ptr
<
TablePositionHandler
>
TablePositionHandlerPtr
;
}
// namespace dmapper
}
// namespace writerfilter
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
writerfilter/source/ooxml/model.xml
Dosyayı görüntüle @
edc4861a
...
...
@@ -22825,6 +22825,9 @@
<attribute
name=
"w"
tokenid=
"ooxml:CT_TblWidth_w"
/>
<attribute
name=
"type"
tokenid=
"ooxml:CT_TblWidth_type"
/>
</resource>
<resource
name=
"CT_TblPPr"
resource=
"Properties"
tag=
"table"
>
<attribute
name=
"vertAnchor"
tokenid=
"ooxml:CT_TblPPr_vertAnchor"
/>
</resource>
<resource
name=
"CT_TblGridCol"
resource=
"Value"
tag=
"table"
>
<attribute
name=
"w"
tokenid=
"ooxml:CT_TblGridCol_w"
action=
"setValue"
/>
<action
name=
"start"
action=
"setDefaultIntegerValue"
/>
...
...
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