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
7803a5d7
Kaydet (Commit)
7803a5d7
authored
Agu 04, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
DOCX import: handle all attributes of CT_TblLook
Change-Id: I3bbd65af4f52ce28e2962a1b3e0c7f1c348f3a01
üst
0ee72863
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
23 deletions
+55
-23
DomainMapper.cxx
writerfilter/source/dmapper/DomainMapper.cxx
+3
-0
DomainMapperTableHandler.cxx
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+18
-23
DomainMapperTableManager.cxx
writerfilter/source/dmapper/DomainMapperTableManager.cxx
+27
-0
DomainMapperTableManager.hxx
writerfilter/source/dmapper/DomainMapperTableManager.hxx
+5
-0
PropertyIds.cxx
writerfilter/source/dmapper/PropertyIds.cxx
+1
-0
PropertyIds.hxx
writerfilter/source/dmapper/PropertyIds.hxx
+1
-0
No files found.
writerfilter/source/dmapper/DomainMapper.cxx
Dosyayı görüntüle @
7803a5d7
...
@@ -2458,7 +2458,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
...
@@ -2458,7 +2458,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
{
{
writerfilter
::
Reference
<
Properties
>::
Pointer_t
pProperties
=
rSprm
.
getProps
();
writerfilter
::
Reference
<
Properties
>::
Pointer_t
pProperties
=
rSprm
.
getProps
();
if
(
pProperties
.
get
())
if
(
pProperties
.
get
())
{
pProperties
->
resolve
(
*
this
);
pProperties
->
resolve
(
*
this
);
m_pImpl
->
getTableManager
().
finishTableLook
();
}
}
}
break
;
break
;
default
:
default
:
...
...
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
Dosyayı görüntüle @
7803a5d7
...
@@ -313,8 +313,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -313,8 +313,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
sal_Int32
nTableWidth
=
0
;
sal_Int32
nTableWidth
=
0
;
sal_Int32
nTableWidthType
=
text
::
SizeType
::
FIX
;
sal_Int32
nTableWidthType
=
text
::
SizeType
::
FIX
;
uno
::
Sequence
<
beans
::
PropertyValue
>
aGrabBag
(
6
);
comphelper
::
SequenceAsHashMap
aGrabBag
;
sal_Int32
nGrabBagSize
=
0
;
if
(
0
!=
m_rDMapper_Impl
.
getTableManager
().
getCurrentTableRealPosition
())
if
(
0
!=
m_rDMapper_Impl
.
getTableManager
().
getCurrentTableRealPosition
())
{
{
...
@@ -352,9 +351,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -352,9 +351,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
aGrabBagTS
[
9
].
Name
=
"vertAnchor"
;
aGrabBagTS
[
9
].
Name
=
"vertAnchor"
;
aGrabBagTS
[
9
].
Value
=
uno
::
makeAny
(
pTablePositions
->
getVertAnchor
()
);
aGrabBagTS
[
9
].
Value
=
uno
::
makeAny
(
pTablePositions
->
getVertAnchor
()
);
aGrabBag
[
nGrabBagSize
].
Name
=
"TablePosition"
;
aGrabBag
[
"TablePosition"
]
=
uno
::
makeAny
(
aGrabBagTS
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
aGrabBagTS
);
nGrabBagSize
++
;
}
}
boost
::
optional
<
PropertyMap
::
Property
>
aTableStyleVal
=
m_aTableProperties
->
getProperty
(
META_PROP_TABLE_STYLE_NAME
);
boost
::
optional
<
PropertyMap
::
Property
>
aTableStyleVal
=
m_aTableProperties
->
getProperty
(
META_PROP_TABLE_STYLE_NAME
);
...
@@ -368,9 +365,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -368,9 +365,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
pTableStyle
=
dynamic_cast
<
TableStyleSheetEntry
*>
(
pStyleSheet
.
get
(
)
);
pTableStyle
=
dynamic_cast
<
TableStyleSheetEntry
*>
(
pStyleSheet
.
get
(
)
);
m_aTableProperties
->
Erase
(
aTableStyleVal
->
first
);
m_aTableProperties
->
Erase
(
aTableStyleVal
->
first
);
aGrabBag
[
nGrabBagSize
].
Name
=
"TableStyleName"
;
aGrabBag
[
"TableStyleName"
]
=
uno
::
makeAny
(
sTableStyleName
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
sTableStyleName
);
nGrabBagSize
++
;
if
(
pStyleSheet
)
if
(
pStyleSheet
)
{
{
...
@@ -386,27 +381,19 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -386,27 +381,19 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
TableInfo
rStyleInfo
;
TableInfo
rStyleInfo
;
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_TOP_BORDER
,
rStyleInfo
,
aBorderLine
))
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_TOP_BORDER
,
rStyleInfo
,
aBorderLine
))
{
{
aGrabBag
[
nGrabBagSize
].
Name
=
"TableStyleTopBorder"
;
aGrabBag
[
"TableStyleTopBorder"
]
=
uno
::
makeAny
(
aBorderLine
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
aBorderLine
);
nGrabBagSize
++
;
}
}
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_BOTTOM_BORDER
,
rStyleInfo
,
aBorderLine
))
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_BOTTOM_BORDER
,
rStyleInfo
,
aBorderLine
))
{
{
aGrabBag
[
nGrabBagSize
].
Name
=
"TableStyleBottomBorder"
;
aGrabBag
[
"TableStyleBottomBorder"
]
=
uno
::
makeAny
(
aBorderLine
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
aBorderLine
);
nGrabBagSize
++
;
}
}
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_LEFT_BORDER
,
rStyleInfo
,
aBorderLine
))
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_LEFT_BORDER
,
rStyleInfo
,
aBorderLine
))
{
{
aGrabBag
[
nGrabBagSize
].
Name
=
"TableStyleLeftBorder"
;
aGrabBag
[
"TableStyleLeftBorder"
]
=
uno
::
makeAny
(
aBorderLine
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
aBorderLine
);
nGrabBagSize
++
;
}
}
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_RIGHT_BORDER
,
rStyleInfo
,
aBorderLine
))
if
(
lcl_extractTableBorderProperty
(
pMergedProperties
,
PROP_RIGHT_BORDER
,
rStyleInfo
,
aBorderLine
))
{
{
aGrabBag
[
nGrabBagSize
].
Name
=
"TableStyleRightBorder"
;
aGrabBag
[
"TableStyleRightBorder"
]
=
uno
::
makeAny
(
aBorderLine
);
aGrabBag
[
nGrabBagSize
].
Value
=
uno
::
makeAny
(
aBorderLine
);
nGrabBagSize
++
;
}
}
#ifdef DEBUG_DOMAINMAPPER
#ifdef DEBUG_DOMAINMAPPER
...
@@ -426,6 +413,15 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -426,6 +413,15 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
}
}
}
}
// This is the one preserving just all the table look attributes.
boost
::
optional
<
PropertyMap
::
Property
>
oTableLook
=
m_aTableProperties
->
getProperty
(
META_PROP_TABLE_LOOK
);
if
(
oTableLook
)
{
aGrabBag
[
"TableStyleLook"
]
=
oTableLook
->
second
;
m_aTableProperties
->
Erase
(
oTableLook
->
first
);
}
// This is just the "val" attribute's numeric value.
const
boost
::
optional
<
PropertyMap
::
Property
>
aTblLook
=
m_aTableProperties
->
getProperty
(
PROP_TBL_LOOK
);
const
boost
::
optional
<
PropertyMap
::
Property
>
aTblLook
=
m_aTableProperties
->
getProperty
(
PROP_TBL_LOOK
);
if
(
aTblLook
)
if
(
aTblLook
)
{
{
...
@@ -442,10 +438,9 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
...
@@ -442,10 +438,9 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
dmapper_logger
->
endElement
();
dmapper_logger
->
endElement
();
#endif
#endif
if
(
nGrabBagSize
>
0
)
if
(
!
aGrabBag
.
empty
()
)
{
{
aGrabBag
.
realloc
(
nGrabBagSize
);
m_aTableProperties
->
Insert
(
PROP_TABLE_INTEROP_GRAB_BAG
,
uno
::
makeAny
(
aGrabBag
.
getAsConstPropertyValueList
()
)
);
m_aTableProperties
->
Insert
(
PROP_TABLE_INTEROP_GRAB_BAG
,
uno
::
makeAny
(
aGrabBag
)
);
}
}
m_aTableProperties
->
getValue
(
TablePropertyMap
::
GAP_HALF
,
nGapHalf
);
m_aTableProperties
->
getValue
(
TablePropertyMap
::
GAP_HALF
,
nGapHalf
);
...
...
writerfilter/source/dmapper/DomainMapperTableManager.cxx
Dosyayı görüntüle @
7803a5d7
...
@@ -85,8 +85,27 @@ bool DomainMapperTableManager::attribute(Id nName, Value& rValue)
...
@@ -85,8 +85,27 @@ bool DomainMapperTableManager::attribute(Id nName, Value& rValue)
TablePropertyMapPtr
pPropMap
(
new
TablePropertyMap
());
TablePropertyMapPtr
pPropMap
(
new
TablePropertyMap
());
pPropMap
->
Insert
(
PROP_TBL_LOOK
,
uno
::
makeAny
(
rValue
.
getInt
()));
pPropMap
->
Insert
(
PROP_TBL_LOOK
,
uno
::
makeAny
(
rValue
.
getInt
()));
insertTableProps
(
pPropMap
);
insertTableProps
(
pPropMap
);
m_aTableLook
[
"val"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
}
}
break
;
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_noVBand
:
m_aTableLook
[
"noVBand"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_noHBand
:
m_aTableLook
[
"noHBand"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_lastColumn
:
m_aTableLook
[
"lastColumn"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_lastRow
:
m_aTableLook
[
"lastRow"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_firstColumn
:
m_aTableLook
[
"firstColumn"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
case
NS_ooxml
:
:
LN_CT_TblLook_firstRow
:
m_aTableLook
[
"firstRow"
]
=
uno
::
makeAny
(
rValue
.
getInt
());
break
;
default
:
default
:
bRet
=
false
;
bRet
=
false
;
}
}
...
@@ -94,6 +113,14 @@ bool DomainMapperTableManager::attribute(Id nName, Value& rValue)
...
@@ -94,6 +113,14 @@ bool DomainMapperTableManager::attribute(Id nName, Value& rValue)
return
bRet
;
return
bRet
;
}
}
void
DomainMapperTableManager
::
finishTableLook
()
{
TablePropertyMapPtr
pPropMap
(
new
TablePropertyMap
());
pPropMap
->
Insert
(
META_PROP_TABLE_LOOK
,
uno
::
makeAny
(
m_aTableLook
.
getAsConstPropertyValueList
()));
m_aTableLook
.
clear
();
insertTableProps
(
pPropMap
);
}
bool
DomainMapperTableManager
::
sprm
(
Sprm
&
rSprm
)
bool
DomainMapperTableManager
::
sprm
(
Sprm
&
rSprm
)
{
{
#ifdef DEBUG_DOMAINMAPPER
#ifdef DEBUG_DOMAINMAPPER
...
...
writerfilter/source/dmapper/DomainMapperTableManager.hxx
Dosyayı görüntüle @
7803a5d7
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "StyleSheetTable.hxx"
#include "StyleSheetTable.hxx"
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <vector>
#include <vector>
#include <comphelper/sequenceashashmap.hxx>
namespace
writerfilter
{
namespace
writerfilter
{
namespace
dmapper
{
namespace
dmapper
{
...
@@ -45,6 +46,8 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
...
@@ -45,6 +46,8 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
sal_Int32
m_nTableWidth
;
//might be set directly or has to be calculated from the column positions
sal_Int32
m_nTableWidth
;
//might be set directly or has to be calculated from the column positions
bool
m_bOOXML
;
bool
m_bOOXML
;
OUString
m_sTableStyleName
;
OUString
m_sTableStyleName
;
/// Grab-bag of table look attributes for preserving.
comphelper
::
SequenceAsHashMap
m_aTableLook
;
std
::
vector
<
TablePositionHandlerPtr
>
m_aTablePositions
;
std
::
vector
<
TablePositionHandlerPtr
>
m_aTablePositions
;
std
::
vector
<
TablePositionHandlerPtr
>
m_aTmpPosition
;
///< Temporarily stores the position to compare it later
std
::
vector
<
TablePositionHandlerPtr
>
m_aTmpPosition
;
///< Temporarily stores the position to compare it later
std
::
vector
<
TablePropertyMapPtr
>
m_aTmpTableProperties
;
///< Temporarily stores the table properties until end of row
std
::
vector
<
TablePropertyMapPtr
>
m_aTmpTableProperties
;
///< Temporarily stores the table properties until end of row
...
@@ -94,6 +97,8 @@ public:
...
@@ -94,6 +97,8 @@ public:
IntVectorPtr
getCurrentCellWidths
(
);
IntVectorPtr
getCurrentCellWidths
(
);
const
OUString
&
getTableStyleName
()
const
{
return
m_sTableStyleName
;
}
const
OUString
&
getTableStyleName
()
const
{
return
m_sTableStyleName
;
}
/// Turn the attributes collected so far in m_aTableLook into a property and clear the container.
void
finishTableLook
();
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
getCurrentTablePosition
();
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
getCurrentTablePosition
();
TablePositionHandler
*
getCurrentTableRealPosition
();
TablePositionHandler
*
getCurrentTableRealPosition
();
...
...
writerfilter/source/dmapper/PropertyIds.cxx
Dosyayı görüntüle @
7803a5d7
...
@@ -395,6 +395,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
...
@@ -395,6 +395,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const
case
PROP_CELL_DIRECTION
:
sName
=
"CellDirection"
;
break
;
case
PROP_CELL_DIRECTION
:
sName
=
"CellDirection"
;
break
;
case
PROP_SDT_END_BEFORE
:
sName
=
"SdtEndBefore"
;
break
;
case
PROP_SDT_END_BEFORE
:
sName
=
"SdtEndBefore"
;
break
;
case
PROP_PARA_SDT_END_BEFORE
:
sName
=
"ParaSdtEndBefore"
;
break
;
case
PROP_PARA_SDT_END_BEFORE
:
sName
=
"ParaSdtEndBefore"
;
break
;
case
META_PROP_TABLE_LOOK
:
sName
=
"TableStyleLook"
;
break
;
}
}
::
std
::
pair
<
PropertyNameMap_t
::
iterator
,
bool
>
aInsertIt
=
::
std
::
pair
<
PropertyNameMap_t
::
iterator
,
bool
>
aInsertIt
=
m_pImpl
->
aNameMap
.
insert
(
PropertyNameMap_t
::
value_type
(
eId
,
sName
));
m_pImpl
->
aNameMap
.
insert
(
PropertyNameMap_t
::
value_type
(
eId
,
sName
));
...
...
writerfilter/source/dmapper/PropertyIds.hxx
Dosyayı görüntüle @
7803a5d7
...
@@ -367,6 +367,7 @@ enum PropertyIds
...
@@ -367,6 +367,7 @@ enum PropertyIds
,
PROP_CELL_DIRECTION
,
PROP_CELL_DIRECTION
,
PROP_SDT_END_BEFORE
,
PROP_SDT_END_BEFORE
,
PROP_PARA_SDT_END_BEFORE
,
PROP_PARA_SDT_END_BEFORE
,
META_PROP_TABLE_LOOK
};
};
struct
PropertyNameSupplier_Impl
;
struct
PropertyNameSupplier_Impl
;
class
PropertyNameSupplier
class
PropertyNameSupplier
...
...
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