Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
987839a6
Commit
987839a6
authored
Aug 05, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatWriter - table cell borders from table props
parent
3aa734c7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
22 deletions
+69
-22
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
...fficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
+6
-5
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
+2
-2
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableCellReader.h
...ceRtfFile/RtfFormatLib/source/Reader/OOXTableCellReader.h
+6
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
...ficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableRowReader.h
...iceRtfFile/RtfFormatLib/source/Reader/OOXTableRowReader.h
+6
-4
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
+48
-6
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXBorderReader.h
View file @
987839a6
...
...
@@ -277,6 +277,7 @@ public:
//oOutputBorder.m_eType = RtfBorder::bt_brdrsh;
//oOutputBorder.m_eType = RtfBorder::bt_brdrhair;
default
:
oOutputBorder
.
m_eType
=
RtfBorder
::
bt_brdrs
;
break
;
}
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXStyleReader.h
View file @
987839a6
...
...
@@ -148,7 +148,7 @@ public:
{
RtfTableStylePtr
oNewTableStyle
=
boost
::
static_pointer_cast
<
RtfTableStyle
,
RtfStyle
>
(
oNewStyle
);
OOXtcPrReader
otcPrReader
(
m_ooxStyle
->
m_oTcPr
.
GetPointer
());
OOXtcPrReader
otcPrReader
(
m_ooxStyle
->
m_oTcPr
.
GetPointer
()
,
m_ooxStyle
->
m_oTblPr
.
GetPointer
()
);
CcnfStyle
style
;
otcPrReader
.
Parse
(
oParam
,
oNewTableStyle
->
m_oCellProp
,
style
,
-
1
,
-
1
,
-
1
,
-
1
);
...
...
@@ -317,7 +317,7 @@ public:
{
RtfTableStylePtr
oNewTableStyle
=
boost
::
static_pointer_cast
<
RtfTableStyle
,
RtfStyle
>
(
oOutputStyle
);
OOXtcPrReader
otcPrReader
(
oox_tableStyle
->
m_oTcPr
.
GetPointer
());
OOXtcPrReader
otcPrReader
(
oox_tableStyle
->
m_oTcPr
.
GetPointer
()
,
oox_tableStyle
->
m_oTblPr
.
GetPointer
()
);
CcnfStyle
style
;
otcPrReader
.
Parse
(
oParam
,
oNewTableStyle
->
m_oCellProp
,
style
,
-
1
,
-
1
,
-
1
,
-
1
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableCellReader.h
View file @
987839a6
...
...
@@ -42,10 +42,12 @@ class OOXTableCellReader
{
private:
OOX
::
Logic
::
CTc
*
m_ooxTableCell
;
OOX
::
Logic
::
CTableProperty
*
m_ooxTableProps
;
public:
OOXTableCellReader
(
OOX
::
Logic
::
CTc
*
ooxTableCell
)
OOXTableCellReader
(
OOX
::
Logic
::
CTc
*
ooxTableCell
,
OOX
::
Logic
::
CTableProperty
*
ooxTableProps
)
{
m_ooxTableCell
=
ooxTableCell
;
m_ooxTableProps
=
ooxTableProps
;
}
bool
Parse
(
ReaderParameter
oParam
,
RtfTableCell
&
oOutputCell
,
CcnfStyle
oConditionalTableStyle
,
int
nCurCell
,
int
nCellCount
,
int
nCurRow
,
int
nRowCount
)
{
...
...
@@ -53,7 +55,7 @@ public:
if
(
m_ooxTableCell
->
m_oTableCellProperties
)
{
OOXtcPrReader
oCellPropReader
(
m_ooxTableCell
->
m_oTableCellProperties
);
OOXtcPrReader
oCellPropReader
(
m_ooxTableCell
->
m_oTableCellProperties
,
m_ooxTableProps
);
oCellPropReader
.
Parse
(
oParam
,
oOutputCell
.
m_oProperty
,
oConditionalTableStyle
,
nCurCell
,
nCellCount
,
nCurRow
,
nRowCount
);
//может поменяться на любой condition (firstRow)
}
else
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableReader.cpp
View file @
987839a6
...
...
@@ -97,7 +97,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
OOX
::
Logic
::
CTr
*
ooxRow
=
dynamic_cast
<
OOX
::
Logic
::
CTr
*>
(
m_ooxTable
->
m_arrItems
[
i
]);
OOXTableRowReader
oRowReader
(
ooxRow
);
OOXTableRowReader
oRowReader
(
ooxRow
,
m_ooxTable
->
m_oTableProperties
);
oRowReader
.
Parse
(
newParam
,
*
oNewRow
,
nCurRow
++
,
nRowCount
);
oOutputTable
.
AddItem
(
oNewRow
);
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableRowReader.h
View file @
987839a6
...
...
@@ -41,10 +41,12 @@ class OOXTableRowReader
{
private:
OOX
::
Logic
::
CTr
*
m_ooxRowTable
;
OOX
::
Logic
::
CTableProperty
*
m_ooxTableProps
;
public:
OOXTableRowReader
(
OOX
::
Logic
::
CTr
*
ooxRowTable
)
OOXTableRowReader
(
OOX
::
Logic
::
CTr
*
ooxRowTable
,
OOX
::
Logic
::
CTableProperty
*
ooxTableProps
)
{
m_ooxRowTable
=
ooxRowTable
;
m_ooxTableProps
=
ooxTableProps
;
}
bool
Parse
(
ReaderParameter
oParam
,
RtfTableRow
&
oOutputRow
,
int
nCurRow
,
int
nRowCount
)
...
...
@@ -73,7 +75,7 @@ public:
if
(
nCurCell
<
m_ooxRowTable
->
m_arrItems
.
size
())
ooxCell
=
dynamic_cast
<
OOX
::
Logic
::
CTc
*>
(
m_ooxRowTable
->
m_arrItems
[
i
]);
OOXTableCellReader
oCellReader
(
ooxCell
);
OOXTableCellReader
oCellReader
(
ooxCell
,
m_ooxTableProps
);
oCellReader
.
Parse
(
oParam
,
*
oNewCell
,
oConditionStyle
,
nCurCell
++
,
nCurRow
,
nCellCount
,
nRowCount
);
//добавляем cell
oOutputRow
.
AddItem
(
oNewCell
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXtcPrReader.h
View file @
987839a6
...
...
@@ -38,10 +38,12 @@
class
OOXtcPrReader
{
OOX
::
Logic
::
CTableCellProperties
*
m_ooxTableCellProps
;
OOX
::
Logic
::
CTableProperty
*
m_ooxTableProps
;
public:
OOXtcPrReader
(
OOX
::
Logic
::
CTableCellProperties
*
ooxTableCell
Props
)
OOXtcPrReader
(
OOX
::
Logic
::
CTableCellProperties
*
ooxTableCellProps
,
OOX
::
Logic
::
CTableProperty
*
ooxTable
Props
)
{
m_ooxTableCellProps
=
ooxTableCellProps
;
m_ooxTableProps
=
ooxTableProps
;
}
bool
Parse
(
ReaderParameter
oParam
,
RtfCellProperty
&
oOutputProperty
,
CcnfStyle
&
oConditionalTableStyle
,
int
nCurCell
,
int
nCellCount
,
int
nCurRow
,
int
nRowCount
)
{
...
...
@@ -151,6 +153,45 @@ public:
oBorderReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oBorderBottom
);
}
}
else
if
(
m_ooxTableProps
)
{
//from table props
//todoo last, first !!!!
//if( m_ooxTableProps->m_oTblBorders->m_oTop.IsInit() )
//{
// OOXBorderReader oBorderReader(m_ooxTableProps->m_oTblBorders->m_oTop.GetPointer());
// oBorderReader.Parse( oParam,oOutputProperty.m_oBorderTop);
//}
//if( m_ooxTableProps->m_oTblBorders->m_oStart.IsInit() )
//{
// OOXBorderReader oBorderReader(m_ooxTableProps->m_oTblBorders->m_oStart.GetPointer());
// oBorderReader.Parse(oParam,oOutputProperty.m_oBorderLeft);
//}
//if( m_ooxTableProps->m_oTblBorders->m_oBottom.IsInit())
//{
// OOXBorderReader oBorderReader(m_ooxTableProps->m_oTblBorders->m_oBottom.GetPointer());
// oBorderReader.Parse(oParam,oOutputProperty.m_oBorderBottom);
//}
//if( m_ooxTableProps->m_oTblBorders->m_oEnd.IsInit() )
//{
// OOXBorderReader oBorderReader(m_ooxTableProps->m_oTblBorders->m_oEnd.GetPointer());
// oBorderReader.Parse(oParam,oOutputProperty.m_oBorderRight);
//}
if
(
m_ooxTableProps
->
m_oTblBorders
->
m_oInsideH
.
IsInit
())
{
OOXBorderReader
oBorderReader
(
m_ooxTableProps
->
m_oTblBorders
->
m_oInsideH
.
GetPointer
());
oBorderReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oBorderTop
);
oBorderReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oBorderBottom
);
}
if
(
m_ooxTableProps
->
m_oTblBorders
->
m_oInsideV
.
IsInit
()
)
{
OOXBorderReader
oBorderReader
(
m_ooxTableProps
->
m_oTblBorders
->
m_oInsideV
.
GetPointer
());
oBorderReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oBorderLeft
);
oBorderReader
.
Parse
(
oParam
,
oOutputProperty
.
m_oBorderRight
);
}
}
if
(
m_ooxTableCellProps
->
m_oShd
.
IsInit
())
{
OOXShadingReader
oShadingReader
(
m_ooxTableCellProps
->
m_oShd
.
GetPointer
());
...
...
@@ -170,12 +211,13 @@ public:
{
switch
(
m_ooxTableCellProps
->
m_oTextDirection
->
m_oVal
->
GetValue
())
{
case
SimpleTypes
:
:
textdirectionLr
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_lrtb
;
case
SimpleTypes
:
:
textdirectionLrV
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_lrtbv
;
case
SimpleTypes
:
:
textdirectionRl
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_tbrl
;
case
SimpleTypes
:
:
textdirectionRlV
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_tbrlv
;
case
SimpleTypes
:
:
textdirectionTb
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_btlr
;
//??
case
SimpleTypes
:
:
textdirectionLr
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_lrtb
;
break
;
case
SimpleTypes
:
:
textdirectionLrV
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_lrtbv
;
break
;
case
SimpleTypes
:
:
textdirectionRl
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_tbrl
;
break
;
case
SimpleTypes
:
:
textdirectionRlV
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_tbrlv
;
break
;
case
SimpleTypes
:
:
textdirectionTbV
:
oOutputProperty
.
m_oCellFlow
=
RtfCellProperty
::
cf_btlr
;
//??
case
SimpleTypes
:
:
textdirectionTb
:
//lrTb .. default
default:
break
;
}
}
if
(
m_ooxTableCellProps
->
m_oGridSpan
.
IsInit
()
&&
m_ooxTableCellProps
->
m_oGridSpan
->
m_oVal
.
IsInit
())
...
...
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