Commit f074d125 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - odp

parent 30f07d3a
......@@ -385,6 +385,10 @@
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\Readers.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
>
......@@ -434,6 +438,10 @@
RelativePath="..\..\Common\FileDownloader\FileDownloader_win.cpp"
>
</File>
<File
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
>
</File>
<File
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
>
......
......@@ -115,6 +115,10 @@ void OoxConverter::convert(PPTX::Logic::Table *oox_table)
{
if (oox_table == NULL) return;
odf_context()->drawing_context()->start_shape(0);//frame
odf_context()->drawing_context()->end_shape();
}
void OoxConverter::convert(PPTX::Logic::Xfrm *oox_xfrm)
{
......@@ -322,8 +326,6 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
{
if (oox_spPr == NULL) return;
bool use_line_from_style = false;
convert(oox_spPr->xfrm.GetPointer());
PPTX::Logic::PrstGeom* prstGeom = &oox_spPr->Geometry.as<PPTX::Logic::PrstGeom>();
......@@ -334,7 +336,10 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
odf_context()->drawing_context()->start_area_properties();
{
convert(&oox_spPr->Fill, oox_sp_style);
if (oox_spPr->Fill.is_init())
convert(&oox_spPr->Fill);
else if (oox_sp_style)
convert(&oox_sp_style->fillRef, 1);
}
odf_context()->drawing_context()->end_area_properties();
......@@ -364,29 +369,22 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
//-----------------------------------------------------------------------------------------------------------------------------
}
void OoxConverter::convert(PPTX::Logic::UniFill *oox_fill, PPTX::Logic::ShapeStyle* oox_sp_style)
void OoxConverter::convert(PPTX::Logic::UniFill *oox_fill, DWORD nARGB)
{
if (oox_fill == NULL) return;
bool use_fill_from_style = false;
PPTX::Logic::NoFill* noFill = &oox_fill->as<PPTX::Logic::NoFill>();
PPTX::Logic::BlipFill* blipFill = &oox_fill->as<PPTX::Logic::BlipFill>();
PPTX::Logic::GradFill* gradFill = &oox_fill->as<PPTX::Logic::GradFill>();
PPTX::Logic::SolidFill* solidFill = &oox_fill->as<PPTX::Logic::SolidFill>();
PPTX::Logic::PattFill* pattFill = &oox_fill->as<PPTX::Logic::PattFill>();
if (solidFill) convert(solidFill);
if (solidFill) convert(solidFill, nARGB);
else if (blipFill) convert(blipFill);
else if (gradFill) convert(gradFill);
else if (pattFill) convert(pattFill);
else if (gradFill) convert(gradFill, nARGB);
else if (pattFill) convert(pattFill, nARGB);
else if (noFill) odf_context()->drawing_context()->set_no_fill();
else use_fill_from_style = true;
if ( use_fill_from_style && oox_sp_style )
{
convert(&oox_sp_style->fillRef, 1);
}
}
int OoxConverter::convert(PPTX::Logic::PrstTxWarp *oox_text_preset)
......@@ -550,7 +548,7 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
}
odf_context()->drawing_context()->end_bitmap_style();
}
void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill, DWORD nARGB)
{
if (!oox_grad_fill) return;
......@@ -586,8 +584,8 @@ void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
std::wstring hexColorStart, hexColorEnd;
_CP_OPT(double) opacityStart, opacityEnd;
convert(&oox_grad_fill->GsLst[0].color,hexColorEnd, opacityEnd);
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size()-1].color,hexColorStart, opacityStart);
convert(&oox_grad_fill->GsLst[0].color,hexColorEnd, opacityEnd, nARGB);
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size()-1].color,hexColorStart, opacityStart, nARGB);
odf_context()->drawing_context()->set_gradient_start(hexColorStart, opacityStart);
odf_context()->drawing_context()->set_gradient_end (hexColorEnd, opacityEnd);
......@@ -628,33 +626,31 @@ void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
}
void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexString, _CP_OPT(double) & opacity)
void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexString, _CP_OPT(double) & opacity, DWORD nARGB)
{
if (!color) return;
DWORD argb = 0;
smart_ptr<PPTX::Logic::ClrMap> clrMap(oox_clrMap()); clrMap.AddRef();
smart_ptr<PPTX::Theme> theme(oox_theme()); theme.AddRef();
argb = color->GetRGBColor(theme, clrMap);
nARGB = color->GetRGBColor(theme, clrMap, nARGB);
hexString = XmlUtils::IntToString(argb & 0x00FFFFFF, L"#%06X");
hexString = XmlUtils::IntToString(nARGB & 0x00FFFFFF, L"#%06X");
if ((argb >> 24) != 0xff)
if ((nARGB >> 24) != 0xff)
{
opacity = ((argb >> 24) /255.) * 100.;
opacity = ((nARGB >> 24) /255.) * 100.;
}
}
void OoxConverter::convert(PPTX::Logic::SolidFill *oox_fill)
void OoxConverter::convert(PPTX::Logic::SolidFill *oox_fill, DWORD nARGB)
{
if (!oox_fill) return;
std::wstring hexString;
_CP_OPT(double) opacity;
convert(&oox_fill->Color, hexString, opacity);
convert(&oox_fill->Color, hexString, opacity, nARGB);
odf_context()->drawing_context()->set_solid_fill(hexString);
......@@ -663,7 +659,7 @@ void OoxConverter::convert(PPTX::Logic::SolidFill *oox_fill)
odf_context()->drawing_context()->set_opacity(*opacity);
}
}
void OoxConverter::convert(PPTX::Logic::PattFill *oox_fill)
void OoxConverter::convert(PPTX::Logic::PattFill *oox_fill, DWORD nARGB)
{
if (!oox_fill) return;
}
......@@ -1191,6 +1187,7 @@ void OoxConverter::convert(PPTX::Logic::StyleRef *style_ref, int type)
PPTX::Logic::UniFill *fill = NULL;
if (index < 1000)
{
index -= 1;
if ((index >= 0) || (index < theme->themeElements.fmtScheme.fillStyleLst.size()))
{
fill = &theme->themeElements.fmtScheme.fillStyleLst[index];
......@@ -1204,10 +1201,12 @@ void OoxConverter::convert(PPTX::Logic::StyleRef *style_ref, int type)
fill = &theme->themeElements.fmtScheme.bgFillStyleLst[index];
}
}
convert(fill);
convert(fill, style_ref->Color.GetARGB());
}
else if (type == 2)
{
//index -= 1;
if ((index >= 0) || (index < theme->themeElements.fmtScheme.lnStyleLst.size()))
{
convert(&theme->themeElements.fmtScheme.lnStyleLst[index]);
......
......@@ -367,9 +367,9 @@ public:
void convert(PPTX::Logic::PrstGeom *oox_geom);
void convert(PPTX::Logic::CustGeom *oox_geom);
void convert(PPTX::Logic::BlipFill *oox_fill);
void convert(PPTX::Logic::GradFill *oox_fill);
void convert(PPTX::Logic::SolidFill *oox_fill);
void convert(PPTX::Logic::PattFill *oox_fill);
void convert(PPTX::Logic::GradFill *oox_fill, DWORD ARGB = 0);
void convert(PPTX::Logic::SolidFill *oox_fill, DWORD ARGB = 0);
void convert(PPTX::Logic::PattFill *oox_fill, DWORD ARGB = 0);
void convert(PPTX::Logic::EffectLst *oox_effect_lst);
void convert(PPTX::Logic::Ln *oox_line);
void convert(PPTX::Logic::FontRef *oox_fontRef);
......@@ -377,8 +377,8 @@ public:
void convert(PPTX::Logic::Path2D *oox_path2D);
void convert(PPTX::Logic::PathBase *oox_path);
void convert(PPTX::Logic::BodyPr *oox_bodyPr);
void convert(PPTX::Logic::UniFill *oox_fill, PPTX::Logic::ShapeStyle* oox_style = NULL);
void convert(PPTX::Logic::UniColor *color, std::wstring & hexString, _CP_OPT(double) & opacity);
void convert(PPTX::Logic::UniFill *oox_fill, DWORD ARGB = 0);
void convert(PPTX::Logic::UniColor *color, std::wstring & hexString, _CP_OPT(double) & opacity, DWORD ARGB = 0);
void convert(PPTX::Logic::NvSpPr *oox_nvSpPr);
void convert(PPTX::Logic::CNvPr *oox_cnvPr);
void convert(PPTX::Logic::CNvSpPr *oox_cnvSpPr);
......
......@@ -314,7 +314,7 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background)
odp_context->drawing_context()->set_background_state(true);
if (oox_background->bgPr.IsInit())
{
convert(&oox_background->bgPr->Fill);
OoxConverter::convert(&oox_background->bgPr->Fill);
//EffectProperties EffectList;
//nullable_bool shadeToTitle;
}
......
......@@ -41,8 +41,8 @@
#include "Media/MediaFile.h"
#include "Media/WavAudioFile.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
#include "../../../ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h"
#include "../../../ASCOfficeDocxFile2/BinWriter/BinWriters.h"
......
......@@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.4.448
VERSION = 2.4.448.000
DEFINES += INTVER=$$VERSION
TARGET = x2t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment