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
01292f17
Kaydet (Commit)
01292f17
authored
Ock 05, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#44053 fix RTF import of implicit horizontal table cell merges
üst
2f1c1708
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
18 deletions
+38
-18
DomainMapperTableManager.cxx
writerfilter/source/dmapper/DomainMapperTableManager.cxx
+33
-5
DomainMapperTableManager.hxx
writerfilter/source/dmapper/DomainMapperTableManager.hxx
+2
-1
DomainMapper_Impl.hxx
writerfilter/source/dmapper/DomainMapper_Impl.hxx
+1
-1
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+2
-9
rtfdocumentimpl.hxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
+0
-2
No files found.
writerfilter/source/dmapper/DomainMapperTableManager.cxx
Dosyayı görüntüle @
01292f17
...
...
@@ -48,7 +48,7 @@ using namespace ::com::sun::star;
using
namespace
::
std
;
DomainMapperTableManager
::
DomainMapperTableManager
(
bool
bOOXML
)
:
DomainMapperTableManager
::
DomainMapperTableManager
(
bool
bOOXML
,
bool
bImplicitMerges
)
:
m_nRow
(
0
),
m_nCell
(
0
),
m_nGridSpan
(
1
),
...
...
@@ -56,6 +56,7 @@ DomainMapperTableManager::DomainMapperTableManager(bool bOOXML) :
m_nHeaderRepeat
(
0
),
m_nTableWidth
(
0
),
m_bOOXML
(
bOOXML
),
m_bImplicitMerges
(
bImplicitMerges
),
m_pTablePropsHandler
(
new
TablePropertiesHandler
(
bOOXML
)
)
{
m_pTablePropsHandler
->
SetTableManager
(
this
);
...
...
@@ -437,12 +438,12 @@ void DomainMapperTableManager::endOfRowAction()
for
(
;
aGridSpanIter
!=
pCurrentSpans
->
end
();
++
aGridSpanIter
)
nGrids
+=
*
aGridSpanIter
;
//determine table width
double
nFullWidth
=
m_nTableWidth
;
//the positions have to be distibuted in a range of 10000
const
double
nFullWidthRelative
=
10000.
;
if
(
pTableGrid
->
size
()
==
nGrids
)
{
//determine table width
double
nFullWidth
=
m_nTableWidth
;
//the positions have to be distibuted in a range of 10000
const
double
nFullWidthRelative
=
10000.
;
uno
::
Sequence
<
text
::
TableColumnSeparator
>
aSeparators
(
m_nCell
-
1
);
text
::
TableColumnSeparator
*
pSeparators
=
aSeparators
.
getArray
();
sal_Int16
nLastRelPos
=
0
;
...
...
@@ -469,6 +470,33 @@ void DomainMapperTableManager::endOfRowAction()
TablePropertyMapPtr
pPropMap
(
new
TablePropertyMap
);
pPropMap
->
Insert
(
PROP_TABLE_COLUMN_SEPARATORS
,
false
,
uno
::
makeAny
(
aSeparators
)
);
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger
->
startElement
(
"rowProperties"
);
pPropMap
->
dumpXml
(
dmapper_logger
);
dmapper_logger
->
endElement
();
#endif
insertRowProps
(
pPropMap
);
}
else
if
(
m_bImplicitMerges
)
{
// More grid than cells definitions? Then take the last ones.
// This feature is used by the RTF implicit horizontal cell merges.
uno
::
Sequence
<
text
::
TableColumnSeparator
>
aSeparators
(
m_nCell
-
1
);
text
::
TableColumnSeparator
*
pSeparators
=
aSeparators
.
getArray
();
sal_Int16
nSum
=
0
;
sal_uInt32
nPos
=
0
;
// Ignoring the i=0 case means we assume that the width of the last cell matches the table width
for
(
int
i
=
m_nCell
;
i
>
1
;
i
--
)
{
nSum
+=
(
*
pTableGrid
.
get
())[
pTableGrid
->
size
()
-
i
];
// Size of the current cell
pSeparators
[
nPos
].
Position
=
nSum
*
nFullWidthRelative
/
nFullWidth
;
// Relative position
pSeparators
[
nPos
].
IsVisible
=
sal_True
;
nPos
++
;
}
TablePropertyMapPtr
pPropMap
(
new
TablePropertyMap
);
pPropMap
->
Insert
(
PROP_TABLE_COLUMN_SEPARATORS
,
false
,
uno
::
makeAny
(
aSeparators
)
);
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger
->
startElement
(
"rowProperties"
);
pPropMap
->
dumpXml
(
dmapper_logger
);
...
...
writerfilter/source/dmapper/DomainMapperTableManager.hxx
Dosyayı görüntüle @
01292f17
...
...
@@ -50,6 +50,7 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
sal_Int32
m_nHeaderRepeat
;
//counter of repeated headers - if == -1 then the repeating stops
sal_Int32
m_nTableWidth
;
//might be set directly or has to be calculated from the column positions
bool
m_bOOXML
;
bool
m_bImplicitMerges
;
::
rtl
::
OUString
m_sTableStyleName
;
PropertyMapPtr
m_pTableStyleTextProperies
;
...
...
@@ -63,7 +64,7 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
public
:
DomainMapperTableManager
(
bool
bOOXML
);
DomainMapperTableManager
(
bool
bOOXML
,
bool
bImplicitMerges
);
virtual
~
DomainMapperTableManager
();
// use this method to avoid adding the properties for the table
...
...
writerfilter/source/dmapper/DomainMapper_Impl.hxx
Dosyayı görüntüle @
01292f17
...
...
@@ -546,7 +546,7 @@ public:
void
appendTableManager
(
)
{
boost
::
shared_ptr
<
DomainMapperTableManager
>
pMngr
(
new
DomainMapperTableManager
(
m_eDocumentType
==
DOCUMENT_OOXML
||
m_eDocumentType
==
DOCUMENT_RTF
)
);
new
DomainMapperTableManager
(
m_eDocumentType
==
DOCUMENT_OOXML
||
m_eDocumentType
==
DOCUMENT_RTF
,
m_eDocumentType
==
DOCUMENT_RTF
)
);
m_aTableManagers
.
push
(
pMngr
);
}
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
01292f17
...
...
@@ -260,7 +260,6 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aFontIndexes
(),
m_aColorTable
(),
m_bFirstRun
(
true
),
m_bFirstRow
(
true
),
m_bNeedPap
(
true
),
m_bNeedCr
(
false
),
m_bNeedPar
(
true
),
...
...
@@ -452,8 +451,6 @@ void RTFDocumentImpl::parBreak()
// If we are not in a table, then the next table row will be the first one.
RTFValue
::
Pointer_t
pValue
=
m_aStates
.
top
().
aParagraphSprms
.
find
(
NS_sprm
::
LN_PFInTable
);
if
(
!
pValue
.
get
())
m_bFirstRow
=
true
;
// start new one
Mapper
().
startParagraphGroup
();
...
...
@@ -1362,7 +1359,6 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case
RTF_ROW
:
case
RTF_NESTROW
:
{
m_bFirstRow
=
false
;
if
(
m_aStates
.
top
().
nCells
)
{
// Make a backup before we start popping elements
...
...
@@ -2281,11 +2277,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
{
int
nCellX
=
nParam
-
m_aStates
.
top
().
nCellX
;
m_aStates
.
top
().
nCellX
=
nParam
;
if
(
m_bFirstRow
)
{
RTFValue
::
Pointer_t
pXValue
(
new
RTFValue
(
nCellX
));
m_aStates
.
top
().
aTableRowSprms
->
push_back
(
make_pair
(
NS_ooxml
::
LN_CT_TblGridBase_gridCol
,
pXValue
));
}
RTFValue
::
Pointer_t
pXValue
(
new
RTFValue
(
nCellX
));
m_aStates
.
top
().
aTableRowSprms
->
push_back
(
make_pair
(
NS_ooxml
::
LN_CT_TblGridBase_gridCol
,
pXValue
));
m_aStates
.
top
().
nCells
++
;
// Push cell properties.
...
...
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Dosyayı görüntüle @
01292f17
...
...
@@ -370,8 +370,6 @@ namespace writerfilter {
/// Color index <-> RGB color value map
std
::
vector
<
sal_uInt32
>
m_aColorTable
;
bool
m_bFirstRun
;
/// If this is the first row in a table - there we send cell widths.
bool
m_bFirstRow
;
/// If paragraph properties should be emitted on next run.
bool
m_bNeedPap
;
/// If we need to emit a CR at the end of substream.
...
...
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