-#include "odfattributes.h"
-
-
-namespace cpdoccore { namespace odf_types {
-
-class message_type
-{
-public:
- enum type
- {
- stop,
- warning,
- information
- };
- message_type() {}
-
- message_type(type _Type) : type_(_Type)
- {}
-
- type get_type() const
- {
- return type_;
- };
-
- static message_type parse(const std::wstring & Str);
-
-private:
- type type_;
-
-};
-
-std::wostream & operator << (std::wostream & _Wostream, const message_type & _Val);
-
-}
-
-APPLY_PARSE_XML_ATTRIBUTES(odf_types::message_type);
-
-}
diff --git a/ASCOfficeOdfFile/src/odf/draw_shapes.cpp b/ASCOfficeOdfFile/src/odf/draw_shapes.cpp
index 943a65067d..7945058cc3 100644
--- a/ASCOfficeOdfFile/src/odf/draw_shapes.cpp
+++ b/ASCOfficeOdfFile/src/odf/draw_shapes.cpp
@@ -257,8 +257,8 @@ void draw_path::reset_svg_path()
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
- bool bClosed = false, bStroked = true;
- bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_path_attlist_.svg_d_.get(), false, bClosed, bStroked);
+ bool bClosed = false;
+ bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_path_attlist_.svg_d_.get(), false, bClosed);
if (!bClosed) lined_shape_ = true;
@@ -713,8 +713,8 @@ void draw_connector::reset_svg_path()
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
- bool bClosed = false, bStroked = true;
- bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_connector_attlist_.svg_d_.get(), false, bClosed, bStroked);
+ bool bClosed = false;
+ bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_connector_attlist_.svg_d_.get(), false, bClosed);
if (!bClosed) lined_shape_ = true;
diff --git a/ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp b/ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
index 774e97f55b..6c855bc9f7 100644
--- a/ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
+++ b/ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
@@ -318,11 +318,11 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
- bool bClosed = false, bStroked = true;
+ bool bClosed = false;
try
{
- res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed, bStroked);
+ res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed);
}
catch(...)
{
@@ -342,10 +342,6 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
int w = 0;
int h = 0;
- if (false == bStroked)
- {
- shape->additional_.push_back(odf_reader::_property(L"custom_path_s", false));
- }
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
diff --git a/ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp b/ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
index 4deacef7ce..53a5316696 100644
--- a/ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
+++ b/ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
@@ -369,11 +369,11 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
- bool bClosed = false, bStroked = true;
+ bool bClosed =false;
try
{
- res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed, bStroked);
+ res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed);
}
catch(...)
{
@@ -389,11 +389,7 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
Context.get_slide_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
set_shape = true;
-
- if (false == bStroked)
- {
- Context.get_slide_context().set_property(odf_reader::_property(L"custom_path_s", false));
- }
+
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
diff --git a/ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp b/ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
index b3d3f455a7..2026d85215 100644
--- a/ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
+++ b/ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
@@ -303,11 +303,11 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
- bool bClosed = false, bStroked = true;
+ bool bClosed = false;
try
{
- res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed, bStroked);
+ res = ::svg_path::parseSvgD(o_Polyline, odf_path_, true, bClosed);
}
catch(...)
{
@@ -322,10 +322,6 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
::svg_path::oox_serialize(output_, o_Polyline);
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
- if (false == bStroked)
- {
- Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path_s", false));
- }
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
diff --git a/ASCOfficeOdfFile/src/odf/odfcontext.cpp b/ASCOfficeOdfFile/src/odf/odfcontext.cpp
index 559cf7b147..76c937a41f 100644
--- a/ASCOfficeOdfFile/src/odf/odfcontext.cpp
+++ b/ASCOfficeOdfFile/src/odf/odfcontext.cpp
@@ -190,7 +190,7 @@ style_instance * style_instance::next() const
{
if (next_)
return next_;
- else if (container_ && next_name_.empty() == false)
+ else if (container_)
next_ = container_->style_by_name(next_name_, type(), false);
return next_;
diff --git a/ASCOfficeOdfFile/src/odf/paragraph_elements.cpp b/ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
index 44eff586d7..9b1dae2eba 100644
--- a/ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
+++ b/ASCOfficeOdfFile/src/odf/paragraph_elements.cpp
@@ -1383,12 +1383,9 @@ void sequence::docx_convert(oox::docx_conversion_context & Context)
// Context.start_bookmark(ref);
//}
- if (template_)
- {
- Context.add_new_run();
- Context.output_stream() << L"" << *template_ << L"";
- Context.finish_run();
- }
+ Context.add_new_run();
+ Context.output_stream() << L"" << template_ << L"";
+ Context.finish_run();
std::wstring num_format = L"ARABIC";
if (style_num_format_)
diff --git a/ASCOfficeOdfFile/src/odf/svg_parser.cpp b/ASCOfficeOdfFile/src/odf/svg_parser.cpp
index 4d7b5e687d..83eab03c22 100644
--- a/ASCOfficeOdfFile/src/odf/svg_parser.cpp
+++ b/ASCOfficeOdfFile/src/odf/svg_parser.cpp
@@ -185,7 +185,7 @@ namespace svg_path
return bUseRelativeCoordinates ? cLowerCaseCommand : cUpperCaseCommand;
}
- bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & rSvgDStatement, bool bWrongPositionAfterZ, bool & bIsClosed, bool & bStroked)
+ bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & rSvgDStatement, bool bWrongPositionAfterZ, bool & bIsClosed)
{
Polyline.clear();
const int nLen(rSvgDStatement.length());
@@ -200,7 +200,6 @@ namespace svg_path
_polyline aCurrPoly;
bIsClosed = false;
- bStroked = true;
// skip initial whitespace
skipSpaces(nPos, rSvgDStatement, nLen);
@@ -221,6 +220,7 @@ namespace svg_path
nPos++;
skipSpaces(nPos, rSvgDStatement, nLen);
+ // remember closed state of current polygon
bIsClosed = true;
// update current point - we're back at the start
@@ -329,6 +329,7 @@ namespace svg_path
case 'v' :
{
bRelative = true;
+ // FALLTHROUGH intended
}
case 'V' ://вертикальная линия
{
@@ -361,16 +362,15 @@ namespace svg_path
case 's' :
{
bRelative = true;
+ // FALLTHROUGH intended
}
case 'S' :
{
nPos++;
skipSpaces(nPos, rSvgDStatement, nLen);
- bool bPresentNumber = false;
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
{
- bPresentNumber = true;
double nX, nY;
double nX2, nY2;
double nX1, nY1;
@@ -408,11 +408,7 @@ namespace svg_path
//keep control point
nLastControlX = nX2;
nLastControlY = nY2;
- }
- if (false == bPresentNumber)
- {
- bStroked = false;
- }
+ }
}break;
case 'c' :
@@ -504,9 +500,298 @@ namespace svg_path
nLastControlY = nY;
}
}break;
+
+ // #100617# quadratic beziers are imported as cubic ones
+ //case 'q' :
+ //{
+ // bRelative = true;
+ //}
+ //case 'Q' :
+ //{
+ // nPos++;
+ // skipSpaces(nPos, rSvgDStatement, nLen);
+
+ // while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
+ // {
+ // double nX, nY;
+ // double nX1, nY1;
+
+ // if(!importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
+
+ // if(bRelative)
+ // {
+ // nX1 += nLastX;
+ // nY1 += nLastY;
+ // nX += nLastX;
+ // nY += nLastY;
+ // }
+
+ // // calculate the cubic bezier coefficients from the quadratic ones
+ // const double nX1Prime((nX1 * 2.0 + nLastX) / 3.0);
+ // const double nY1Prime((nY1 * 2.0 + nLastY) / 3.0);
+ // const double nX2Prime((nX1 * 2.0 + nX) / 3.0);
+ // const double nY2Prime((nY1 * 2.0 + nY) / 3.0);
+
+ // // ensure existance of start point
+ // if(!aCurrPoly.size())
+ // {
+ // aCurrPoly.append(_point(nLastX, nLastY));
+ // }
+
+ // // append curved edge
+ // aCurrPoly.appendBezierSegment(_point(nX1Prime, nY1Prime), _point(nX2Prime, nY2Prime), _point(nX, nY));
+
+ // // set last position
+ // nLastX = nX;
+ // nLastY = nY;
+ // }
+ // break;
+ //}
+
+ //// #100617# relative quadratic beziers are imported as cubic
+ //case 't' :
+ //{
+ // bRelative = true;
+ //}
+ //case 'T' :
+ //{
+ // nPos++;
+ // skipSpaces(nPos, rSvgDStatement, nLen);
+
+ // while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
+ // {
+ // double nX, nY;
+
+ // if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
+
+ // if(bRelative)
+ // {
+ // nX += nLastX;
+ // nY += nLastY;
+ // }
+
+ // // ensure existance of start point
+ // if(!aCurrPoly.size())
+ // {
+ // aCurrPoly.append(_point(nLastX, nLastY));
+ // }
+
+ // // get first control point. It's the reflection of the PrevControlPoint
+ // // of the last point. If not existent, use current point (see SVG)
+ // _point aPrevControl(_point(nLastX, nLastY));
+ // const sal_uInt32 nIndex(aCurrPoly.size() - 1);
+ // const _point aPrevPoint(aCurrPoly.getB2DPoint(nIndex));
+
+ // if(aCurrPoly.areControlPointsUsed() && aCurrPoly.isPrevControlPointUsed(nIndex))
+ // {
+ // const _point aPrevControlPoint(aCurrPoly.getPrevControlPoint(nIndex));
+
+ // // use mirrored previous control point
+ // aPrevControl.setX((2.0 * aPrevPoint.getX()) - aPrevControlPoint.getX());
+ // aPrevControl.setY((2.0 * aPrevPoint.getY()) - aPrevControlPoint.getY());
+ // }
+
+ // if(!aPrevControl.equal(aPrevPoint))
+ // {
+ // // there is a prev control point, and we have the already mirrored one
+ // // in aPrevControl. We also need the quadratic control point for this
+ // // new quadratic segment to calculate the 2nd cubic control point
+ // const _point aQuadControlPoint(
+ // ((3.0 * aPrevControl.getX()) - aPrevPoint.getX()) / 2.0,
+ // ((3.0 * aPrevControl.getY()) - aPrevPoint.getY()) / 2.0);
+
+ // // calculate the cubic bezier coefficients from the quadratic ones.
+ // const double nX2Prime((aQuadControlPoint.getX() * 2.0 + nX) / 3.0);
+ // const double nY2Prime((aQuadControlPoint.getY() * 2.0 + nY) / 3.0);
+
+ // // append curved edge, use mirrored cubic control point directly
+ // aCurrPoly.appendBezierSegment(aPrevControl, _point(nX2Prime, nY2Prime), _point(nX, nY));
+ // }
+ // else
+ // {
+ // // when no previous control, SVG says to use current point -> straight line.
+ // // Just add end point
+ // aCurrPoly.append(_point(nX, nY));
+ // }
+
+ // // set last position
+ // nLastX = nX;
+ // nLastY = nY;
+ // }
+ // break;
+ //}
+
+ //case 'a' :
+ //{
+ // bRelative = true;
+ //}
+ //case 'A' :
+ //{
+ // nPos++;
+ // skipSpaces(nPos, rSvgDStatement, nLen);
+
+ // while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
+ // {
+ // double nX, nY;
+ // double fRX, fRY, fPhi;
+ // int bLargeArcFlag, bSweepFlag;
+
+ // if(!importDoubleAndSpaces(fRX, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(fRY, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(fPhi, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importFlagAndSpaces(bLargeArcFlag, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importFlagAndSpaces(bSweepFlag, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
+ // if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
+
+ // if(bRelative)
+ // {
+ // nX += nLastX;
+ // nY += nLastY;
+ // }
+
+ // if( nX == nLastX && nY == nLastY )
+ // continue; // start==end -> skip according to SVG spec
+
+ // if( fRX == 0.0 || fRY == 0.0 )
+ // {
+ // // straight line segment according to SVG spec
+ // aCurrPoly.append(_point(nX, nY));
+ // }
+ // else
+ // {
+ // // normalize according to SVG spec
+ // fRX=fabs(fRX); fRY=fabs(fRY);
+
+ // // from the SVG spec, appendix F.6.4
+
+ // // |x1'| |cos phi sin phi| |(x1 - x2)/2|
+ // // |y1'| = |-sin phi cos phi| |(y1 - y2)/2|
+ // const _point p1(nLastX, nLastY);
+ // const _point p2(nX, nY);
+ // B2DHomMatrix aTransform(basegfx::tools::createRotateB2DHomMatrix(-fPhi*M_PI/180));
+
+ // const _point p1_prime( aTransform * _point(((p1-p2)/2.0)) );
+
+ // // ______________________________________ rx y1'
+ // // |cx'| + / rx^2 ry^2 - rx^2 y1'^2 - ry^2 x1^2 ry
+ // // |cy'| =-/ rx^2y1'^2 + ry^2 x1'^2 - ry x1'
+ // // rx
+ // // chose + if f_A != f_S
+ // // chose - if f_A = f_S
+ // _point aCenter_prime;
+ // const double fRadicant(
+ // (fRX*fRX*fRY*fRY - fRX*fRX*p1_prime.getY()*p1_prime.getY() - fRY*fRY*p1_prime.getX()*p1_prime.getX())/
+ // (fRX*fRX*p1_prime.getY()*p1_prime.getY() + fRY*fRY*p1_prime.getX()*p1_prime.getX()));
+ // if( fRadicant < 0.0 )
+ // {
+ // // no solution - according to SVG
+ // // spec, scale up ellipse
+ // // uniformly such that it passes
+ // // through end points (denominator
+ // // of radicant solved for fRY,
+ // // with s=fRX/fRY)
+ // const double fRatio(fRX/fRY);
+ // const double fRadicant2(
+ // p1_prime.getY()*p1_prime.getY() +
+ // p1_prime.getX()*p1_prime.getX()/(fRatio*fRatio));
+ // if( fRadicant2 < 0.0 )
+ // {
+ // // only trivial solution, one
+ // // of the axes 0 -> straight
+ // // line segment according to
+ // // SVG spec
+ // aCurrPoly.append(_point(nX, nY));
+ // continue;
+ // }
+
+ // fRY=sqrt(fRadicant2);
+ // fRX=fRatio*fRY;
+
+ // // keep center_prime forced to (0,0)
+ // }
+ // else
+ // {
+ // const double fFactor(
+ // (bLargeArcFlag==bSweepFlag ? -1.0 : 1.0) *
+ // sqrt(fRadicant));
+
+ // // actually calculate center_prime
+ // aCenter_prime = _point(
+ // fFactor*fRX*p1_prime.getY()/fRY,
+ // -fFactor*fRY*p1_prime.getX()/fRX);
+ // }
+
+ // // + u - v
+ // // angle(u,v) = arccos( ------------ ) (take the sign of (ux vy - uy vx))
+ // // - ||u|| ||v||
+
+ // // 1 | (x1' - cx')/rx |
+ // // theta1 = angle(( ), | | )
+ // // 0 | (y1' - cy')/ry |
+ // const _point aRadii(fRX,fRY);
+ // double fTheta1(
+ // B2DVector(1.0,0.0).angle(
+ // (p1_prime-aCenter_prime)/aRadii));
+
+ // // |1| | (-x1' - cx')/rx |
+ // // theta2 = angle( | | , | | )
+ // // |0| | (-y1' - cy')/ry |
+ // double fTheta2(
+ // B2DVector(1.0,0.0).angle(
+ // (-p1_prime-aCenter_prime)/aRadii));
+
+ // // map both angles to [0,2pi)
+ // fTheta1 = fmod(2*M_PI+fTheta1,2*M_PI);
+ // fTheta2 = fmod(2*M_PI+fTheta2,2*M_PI);
+
+ // // make sure the large arc is taken
+ // // (since
+ // // createPolylineFromEllipseSegment()
+ // // normalizes to e.g. cw arc)
+ // if( !bSweepFlag )
+ // std::swap(fTheta1,fTheta2);
+
+ // // finally, create bezier polygon from this
+ // B2DPolyline aSegment(
+ // tools::createPolylineFromUnitEllipseSegment(
+ // fTheta1, fTheta2 ));
+
+ // // transform ellipse by rotation & move to final center
+ // aTransform = basegfx::tools::createScaleB2DHomMatrix(fRX, fRY);
+ // aTransform.translate(aCenter_prime.getX(),
+ // aCenter_prime.getY());
+ // aTransform.rotate(fPhi*M_PI/180);
+ // const _point aOffset((p1+p2)/2.0);
+ // aTransform.translate(aOffset.getX(),
+ // aOffset.getY());
+ // aSegment.transform(aTransform);
+
+ // // createPolylineFromEllipseSegment()
+ // // always creates arcs that are
+ // // positively oriented - flip polygon
+ // // if we swapped angles above
+ // if( !bSweepFlag )
+ // aSegment.flip();
+ // aCurrPoly.append(aSegment);
+ // }
+
+ // // set last position
+ // nLastX = nX;
+ // nLastY = nY;
+ // }
+ // break;
+ //}
+
default:
{
- ++nPos;
+ //OSL_FAIL("importFromSvgD(): skipping tags in svg:d element (unknown)!");
+ //OSL_TRACE("importFromSvgD(): skipping tags in svg:d element (unknown: \"%c\")!", aCurrChar);
+ ++nPos;
break;
}
}
diff --git a/ASCOfficeOdfFile/src/odf/svg_parser.h b/ASCOfficeOdfFile/src/odf/svg_parser.h
index abd5bf8091..e439782dd9 100644
--- a/ASCOfficeOdfFile/src/odf/svg_parser.h
+++ b/ASCOfficeOdfFile/src/odf/svg_parser.h
@@ -58,7 +58,7 @@ namespace svg_path
};
bool parseVml(std::vector<_polyline> & Polyline, const std::wstring & path);
- bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & path, bool bWrongPositionAfterZ, bool & bIsClosed, bool & bIsStroked);
+ bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & path, bool bWrongPositionAfterZ, bool & bIsClosed);
bool parsePolygon(std::vector<_polyline> & Polyline, const std::wstring & path, bool bWrongPositionAfterZ, bool closed);
}
diff --git a/ASCOfficeOdfFile/src/odf/table.cpp b/ASCOfficeOdfFile/src/odf/table.cpp
index 0ee30990a2..b8b8d2a72c 100644
--- a/ASCOfficeOdfFile/src/odf/table.cpp
+++ b/ASCOfficeOdfFile/src/odf/table.cpp
@@ -837,6 +837,7 @@ const wchar_t * table_help_message::name = L"help-message";
void table_help_message::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:title", table_title_);
+ CP_APPLY_ATTR(L"table:message-type", table_message_type_);
CP_APPLY_ATTR(L"table:display", table_display_);
}
void table_help_message::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
diff --git a/ASCOfficeOdfFile/src/odf/table.h b/ASCOfficeOdfFile/src/odf/table.h
index 353a73c6d0..c0ad35d64f 100644
--- a/ASCOfficeOdfFile/src/odf/table.h
+++ b/ASCOfficeOdfFile/src/odf/table.h
@@ -47,7 +47,6 @@
#include "datatypes/tablemode.h"
#include "datatypes/common_attlists.h"
#include "datatypes/tablevisibility.h"
-#include "datatypes/messagetype.h"
namespace cpdoccore {
namespace odf_reader {
@@ -777,11 +776,11 @@ public:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
- _CP_OPT(std::wstring) table_title_;
- _CP_OPT(odf_types::Bool) table_display_;
- _CP_OPT(odf_types::message_type) table_message_type_;
+ _CP_OPT(std::wstring) table_title_;
+ _CP_OPT(odf_types::Bool) table_display_;
+ _CP_OPT(std::wstring) table_message_type_;
- office_element_ptr_array content_;
+ office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_error_message);
@@ -801,10 +800,11 @@ public:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
- _CP_OPT(std::wstring) table_title_;
- _CP_OPT(odf_types::Bool) table_display_;
-
- office_element_ptr_array content_;
+ _CP_OPT(std::wstring) table_title_;
+ _CP_OPT(odf_types::Bool) table_display_;
+ _CP_OPT(std::wstring) table_message_type_;
+
+ office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_help_message);
diff --git a/ASCOfficeOdfFile/src/odf/table_xlsx.cpp b/ASCOfficeOdfFile/src/odf/table_xlsx.cpp
index f4238f3199..ca93344c68 100644
--- a/ASCOfficeOdfFile/src/odf/table_xlsx.cpp
+++ b/ASCOfficeOdfFile/src/odf/table_xlsx.cpp
@@ -1329,8 +1329,7 @@ void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Conte
std::wstring content = Context.get_text_context().end_only_text();
Context.get_dataValidations_context().add_error_msg(name, error->table_title_.get_value_or(L""), content,
- error->table_display_ ? error->table_display_->get() : true,
- error->table_message_type_.get_value_or(message_type::stop).get_type());
+ error->table_display_ ? error->table_display_->get() : true);
}
else if (content_[i]->get_type() == typeTableHelpMassage)
{
diff --git a/ASCOfficeOdfFile/src/odf/text_elements.cpp b/ASCOfficeOdfFile/src/odf/text_elements.cpp
index e01991d664..eed26d0c19 100644
--- a/ASCOfficeOdfFile/src/odf/text_elements.cpp
+++ b/ASCOfficeOdfFile/src/odf/text_elements.cpp
@@ -111,6 +111,21 @@ void process_paragraph_drop_cap_attr(const paragraph_attrs & Attr, oox::docx_con
}
}
+void process_paragraph_index(const paragraph_attrs & Attr, oox::docx_conversion_context & Context)
+{
+ if (false == Context.is_table_content()) return;
+
+ if (Attr.text_style_name_.empty())return;
+
+ style_instance * styleInst
+ = Context.root()->odf_context().styleContainer().style_by_name(Attr.text_style_name_, style_family::Paragraph, Context.process_headers_footers_);
+ if ((!styleInst) || (styleInst->is_automatic() == false))return;
+
+ if (L"index" != styleInst->style_class()) return;
+
+
+}
+
}
std::wostream & paragraph::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
@@ -255,7 +270,7 @@ size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context)
}
void paragraph::docx_convert(oox::docx_conversion_context & Context)
{
- std::wstring styleName = attrs_.text_style_name_;
+ const std::wstring & styleName = attrs_.text_style_name_;
bool in_drawing = false;
@@ -925,13 +940,11 @@ void table_of_content::add_child_element( xml::sax * Reader, const std::wstring
}
void table_of_content::docx_convert(oox::docx_conversion_context & Context)
{
- if (section_attr_.style_name_ && false == section_attr_.name_.empty()) // ??? ||
- {
- std::wstring current_page_properties = Context.get_page_properties();
- Context.get_section_context().add_section(section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
- Context.add_page_properties(current_page_properties);
- }
-
+ std::wstring current_page_properties = Context.get_page_properties();
+
+ Context.get_section_context().add_section (section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
+
+ Context.add_page_properties(current_page_properties);
if (index_body_)
{
Context.start_sdt(1);
@@ -1136,22 +1149,22 @@ const wchar_t * table_index_entry_template::name = L"table-index-entry-template"
const wchar_t * illustration_index::ns = L"text";
const wchar_t * illustration_index::name = L"illustration-index";
-//void illustration_index::afterCreate()
-//{
-// office_element::afterCreate();
-//
-// if (document_context * context = getContext())
-// {
-// if (p *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// else if (h *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// }
-//}
+void illustration_index::afterCreate()
+{
+ office_element::afterCreate();
+
+ if (document_context * context = getContext())
+ {
+ if (p *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ else if (h *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ }
+}
void illustration_index::afterReadContent()
{
@@ -1170,12 +1183,9 @@ void illustration_index::afterReadContent()
}
void illustration_index::docx_convert(oox::docx_conversion_context & Context)
{
- if (section_attr_.style_name_ && false == section_attr_.name_.empty()) // ??? ||
- {
- std::wstring current_page_properties = Context.get_page_properties();
- Context.get_section_context().add_section(section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
- Context.add_page_properties(current_page_properties);
- }
+ std::wstring current_page_properties = Context.get_page_properties();
+ Context.get_section_context().add_section (section_attr_.name_,section_attr_.style_name_.get_value_or(L""), current_page_properties);
+ Context.add_page_properties(current_page_properties);
if (index_body_)
{
@@ -1293,22 +1303,22 @@ void alphabetical_index::add_child_element( xml::sax * Reader, const std::wstrin
CP_CREATE_ELEMENT(alphabetical_index_source_);
}
}
-//void alphabetical_index::afterCreate()
-//{
-// office_element::afterCreate();
-//
-// if (document_context * context = getContext())
-// {
-// if (p *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// else if (h *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// }
-//}
+void alphabetical_index::afterCreate()
+{
+ office_element::afterCreate();
+
+ if (document_context * context = getContext())
+ {
+ if (p *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ else if (h *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ }
+}
void alphabetical_index::afterReadContent()
{
if (document_context * context = getContext())
@@ -1326,12 +1336,9 @@ void alphabetical_index::afterReadContent()
}
void alphabetical_index::docx_convert(oox::docx_conversion_context & Context)
{
- if (section_attr_.style_name_ && false == section_attr_.name_.empty()) // ??? ||
- {
- std::wstring current_page_properties = Context.get_page_properties();
- Context.get_section_context().add_section(section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
- Context.add_page_properties(current_page_properties);
- }
+ std::wstring current_page_properties = Context.get_page_properties();
+ Context.get_section_context().add_section (section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
+ Context.add_page_properties(current_page_properties);
if (index_body_)
{
@@ -1412,22 +1419,22 @@ void alphabetical_index_entry_template::docx_convert(oox::docx_conversion_contex
const wchar_t * object_index::ns = L"text";
const wchar_t * object_index::name = L"object-index";
-//void object_index::afterCreate()
-//{
-// office_element::afterCreate();
-//
-// if (document_context * context = getContext())
-// {
-// if (p *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// else if (h *lastPar = dynamic_cast(context->get_last_element()))
-// {
-// lastPar->paragraph_.set_next_section(true);
-// }
-// }
-//}
+void object_index::afterCreate()
+{
+ office_element::afterCreate();
+
+ if (document_context * context = getContext())
+ {
+ if (p *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ else if (h *lastPar = dynamic_cast(context->get_last_element()))
+ {
+ lastPar->paragraph_.set_next_section(true);
+ }
+ }
+}
void object_index::afterReadContent()
{
if (document_context * context = getContext())
@@ -1711,12 +1718,9 @@ void bibliography::afterReadContent()
}
void bibliography::docx_convert(oox::docx_conversion_context & Context)
{
- if (section_attr_.style_name_ && false == section_attr_.name_.empty()) // ??? ||
- {
- std::wstring current_page_properties = Context.get_page_properties();
- Context.get_section_context().add_section(section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
- Context.add_page_properties(current_page_properties);
- }
+ std::wstring current_page_properties = Context.get_page_properties();
+ Context.get_section_context().add_section (section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
+ Context.add_page_properties(current_page_properties);
if (index_body_)
{
diff --git a/ASCOfficeOdfFile/src/odf/text_elements.h b/ASCOfficeOdfFile/src/odf/text_elements.h
index 251852e373..81e9bdc12a 100644
--- a/ASCOfficeOdfFile/src/odf/text_elements.h
+++ b/ASCOfficeOdfFile/src/odf/text_elements.h
@@ -366,7 +366,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
- //virtual void afterCreate();
+ virtual void afterCreate();
virtual void afterReadContent();
void docx_convert(oox::docx_conversion_context & Context);
@@ -398,7 +398,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
- //virtual void afterCreate();
+ virtual void afterCreate();
virtual void afterReadContent();
void docx_convert(oox::docx_conversion_context & Context);
@@ -430,7 +430,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
- //virtual void afterCreate();
+ virtual void afterCreate();
virtual void afterReadContent();
void docx_convert(oox::docx_conversion_context & Context);
diff --git a/ASCOfficeOdfFile/win32/cpcommon.vcxproj b/ASCOfficeOdfFile/win32/cpcommon.vcxproj
index 1478f57960..857c809a91 100644
--- a/ASCOfficeOdfFile/win32/cpcommon.vcxproj
+++ b/ASCOfficeOdfFile/win32/cpcommon.vcxproj
@@ -229,7 +229,6 @@
-
@@ -357,7 +356,6 @@
-
diff --git a/ASCOfficeOdfFile/win32/cpcommon.vcxproj.filters b/ASCOfficeOdfFile/win32/cpcommon.vcxproj.filters
index 3334a2dc46..4bb9b4efd9 100644
--- a/ASCOfficeOdfFile/win32/cpcommon.vcxproj.filters
+++ b/ASCOfficeOdfFile/win32/cpcommon.vcxproj.filters
@@ -345,9 +345,6 @@
datatypes odf
-
- datatypes odf
-
@@ -671,8 +668,5 @@
datatypes odf
-
- datatypes odf
-
\ No newline at end of file
diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
index 72f6c19a72..38aae63581 100644
--- a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
@@ -1330,16 +1330,11 @@ void odf_drawing_context::set_opacity(double percent_)
switch(impl_->current_drawing_part_)
{
case Area:
- {
- if (impl_->current_drawing_state_.oox_shape_preset_ == 3000)
- impl_->current_graphic_properties->common_draw_fill_attlist_.draw_image_opacity_ = percent(percent_);
- else
- impl_->current_graphic_properties->common_draw_fill_attlist_.draw_opacity_ = percent(percent_);
- }break;
+ impl_->current_graphic_properties->common_draw_fill_attlist_.draw_opacity_ = percent(percent_);
+ break;
case Line:
- {
impl_->current_graphic_properties->svg_stroke_opacity_ = percent(percent_);
- }break;
+ break;
}
}
void odf_drawing_context::set_grayscale()
@@ -2186,8 +2181,7 @@ void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double)
}
void odf_drawing_context::set_line_width(double pt)
{
- if (!impl_->current_graphic_properties) return;
-
+ if (!impl_->current_graphic_properties)return;
impl_->current_graphic_properties->svg_stroke_width_ = length(length(pt,length::pt).get_value_unit(length::cm), length::cm);
}
@@ -2463,9 +2457,9 @@ void odf_drawing_context::set_textarea_font(std::wstring & latin, std::wstring &
if (!impl_->current_text_properties) return;
- if (!ea.empty()) impl_->current_text_properties->content_.fo_font_family_ = latin;
+ if (!ea.empty()) impl_->current_text_properties->content_.fo_font_family_ = ea;
if (!cs.empty()) impl_->current_text_properties->content_.style_font_family_complex_ = cs;
- if (!latin.empty()) impl_->current_text_properties->content_.style_font_family_asian_ = ea;
+ if (!latin.empty()) impl_->current_text_properties->content_.style_font_family_asian_ = latin;
}
void odf_drawing_context::set_textarea_fontcolor(std::wstring hexColor)
diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_number_styles_context.cpp b/ASCOfficeOdfFileW/source/OdfFormat/odf_number_styles_context.cpp
index 818de0dbf0..007bd0804b 100644
--- a/ASCOfficeOdfFileW/source/OdfFormat/odf_number_styles_context.cpp
+++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_number_styles_context.cpp
@@ -245,7 +245,7 @@ void odf_number_styles_context::create(int oox_num_fmt, std::wstring formatCode)
number_format_state state;
state.oox_num_fmt = oox_num_fmt;
- state.style_name = std::wstring(L"NF1000") + boost::lexical_cast( number_format_array_.size() + 1);
+ state.style_name = std::wstring(L"NF1000") + boost::lexical_cast( number_format_array_.size()+1);
state.ods_type = office_value_type::Custom;
state.language_code = 0;
@@ -253,7 +253,7 @@ void odf_number_styles_context::create(int oox_num_fmt, std::wstring formatCode)
boost::algorithm::split(state.format_code, formatCode, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
- if (state.format_code.size() > 1 && state.format_code[state.format_code.size() - 1].find(L"@") >= 0)
+ if (state.format_code.size()>1 && state.format_code[state.format_code.size()-1].find(L"@")>=0)
{
state.format_code.pop_back();
}
@@ -357,13 +357,7 @@ void odf_number_styles_context::create_default(int oox_num_fmt, std::wstring for
}
number_format_state & odf_number_styles_context::add_or_find(int oox_num_fmt, std::wstring formatCode)
{
- if (oox_num_fmt < 0)
- {
- //not spreadsheet todooo - search by formatCode
- oox_num_fmt = 0xffff + named_link_map_.size();
- }
-
- if (named_link_map_.count(oox_num_fmt) > 0)
+ if (named_link_map_.count(oox_num_fmt) > 0)
{
return number_format_array_[named_link_map_.at(oox_num_fmt)];
}
@@ -376,7 +370,7 @@ number_format_state & odf_number_styles_context::add_or_find(int oox_num_fmt, st
void odf_number_styles_context::process_styles(office_element_ptr root )
{
- for (size_t i = 0; i< number_format_array_.size(); i++)
+ for (size_t i=0; i< number_format_array_.size(); i++)
{
create_style(number_format_array_[i]);
@@ -822,7 +816,7 @@ void odf_number_styles_context::create_text_style(number_format_state & state, o
void odf_number_styles_context::detect_format(number_format_state & state)
{
- if (state.ods_type != office_value_type::Custom) return;
+ if (state.ods_type != office_value_type::Custom)return;
if (state.format_code.empty())return;
//find [$-].
diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_state.h b/ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_state.h
index b7699da4da..f042ed307a 100644
--- a/ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_state.h
+++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_state.h
@@ -82,7 +82,6 @@ public:
void set_layout_style_name (std::wstring name);
void set_display_name (std::wstring & name);
- void set_class(const std::wstring &value);
office_element_ptr & get_root();
office_element_ptr & get_last_element();
diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp b/ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
index 3bef812db0..549286c567 100644
--- a/ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
+++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
@@ -85,7 +85,7 @@ void odf_style_state::add_child(office_element_ptr & child)
odf_style_->add_child_element(child);
}
-void odf_style_state::set_name(const std::wstring &name)
+void odf_style_state::set_name(std::wstring name)
{
odf_style_name_ = name;
@@ -94,19 +94,14 @@ void odf_style_state::set_name(const std::wstring &name)
style_->style_name_ = name;
}
-void odf_style_state::set_display_name(const std::wstring &name)
+
+void odf_style_state::set_display_name(std::wstring name)
{
style* style_ = dynamic_cast