Compare commits

..

12 Commits

15 changed files with 224 additions and 42 deletions

7
.gitignore vendored
View File

@ -13,6 +13,11 @@ Common/3dParty/cef/win_32
Common/3dParty/cef/linux_64
Common/3dParty/cef/linux_32
Common/3dParty/cef/mac_64
Common/3dParty/curl/win_64
Common/3dParty/curl/win_32
Common/3dParty/curl/linux_64
Common/3dParty/curl/linux_32
Common/3dParty/curl/mac_64
Common/3dParty/v8/v8
Common/3dParty/v8/depot_tools
Common/3dParty/v8/win_64
@ -40,6 +45,8 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
ASCOfficeXlsFile2/win32/dlldata.c
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
X2tConverter/**/Makefile.*
*.7z
*.obj
*.pdb
*.tlb

View File

@ -780,7 +780,9 @@ public:
std::wstring Name;
std::wstring Id;
BYTE byteType;
bool bDefault;
bool Default;
bool Custom;
std::wstring Aliases;
std::wstring BasedOn;
std::wstring NextId;
std::wstring Link;
@ -789,6 +791,11 @@ public:
bool hidden;
bool semiHidden;
bool unhideWhenUsed;
bool autoRedefine;
bool locked;
bool personal;
bool personalCompose;
bool personalReply;
std::wstring TextPr;
std::wstring ParaPr;
std::wstring TablePr;
@ -796,22 +803,36 @@ public:
std::wstring CellPr;
std::vector<std::wstring> TblStylePr;
bool bDefault;
bool bCustom;
bool bqFormat;
bool buiPriority;
bool bhidden;
bool bsemiHidden;
bool bunhideWhenUsed;
bool bautoRedefine;
bool blocked;
bool bpersonal;
bool bpersonalCompose;
bool bpersonalReply;
public:
docStyle()
{
byteType = styletype_Paragraph;
bDefault = false;
bCustom = false;
bqFormat = false;
buiPriority = false;
bhidden = false;
bsemiHidden = false;
bunhideWhenUsed = false;
bautoRedefine = false;
blocked = false;
bpersonal = false;
bpersonalCompose = false;
bpersonalReply = false;
}
void Write(XmlUtils::CStringWriter* pCStringWriter)
{
@ -827,10 +848,35 @@ public:
{
std::wstring sStyle = L"<w:style w:type=\"" + sType + L"\" w:styleId=\"" + Id + L"\"";
if(bDefault)
sStyle += L" w:default=\"1\"";
{
if(Default)
sStyle += L" w:default=\"1\"";
else
sStyle += L" w:default=\"0\"";
}
if(bCustom)
{
if(Custom)
sStyle += L" w:customStyle=\"1\"";
else
sStyle += L" w:customStyle=\"0\"";
}
sStyle += L">";
pCStringWriter->WriteString(sStyle);
if(!Aliases.empty())
{
pCStringWriter->WriteString(L"<w:aliases w:val=\"");
pCStringWriter->WriteEncodeXmlString(Aliases);
pCStringWriter->WriteString(L"\"/>");
}
if(bautoRedefine)
{
if(autoRedefine)
pCStringWriter->WriteString(L"<w:autoRedefine/>");
else
pCStringWriter->WriteString(L"<w:autoRedefine val=\"false\"/>");
}
if(!Name.empty())
{
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
@ -843,12 +889,40 @@ public:
{
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
}
if(bpersonal)
{
if(personal)
pCStringWriter->WriteString(L"<w:personal/>");
else
pCStringWriter->WriteString(L"<w:personal val=\"false\"/>");
}
if(bpersonalCompose)
{
if(personalCompose)
pCStringWriter->WriteString(L"<w:personalCompose/>");
else
pCStringWriter->WriteString(L"<w:personalCompose val=\"false\"/>");
}
if(bpersonalReply)
{
if(personalReply)
pCStringWriter->WriteString(L"<w:personalReply/>");
else
pCStringWriter->WriteString(L"<w:personalReply val=\"false\"/>");
}
if(!Link.empty())
{
pCStringWriter->WriteString(L"<w:link w:val=\"");
pCStringWriter->WriteEncodeXmlString(Link);
pCStringWriter->WriteString(L"\"/>");
}
if(blocked)
{
if(locked)
pCStringWriter->WriteString(L"<w:locked/>");
else
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
}
if(bqFormat)
{
if(qFormat)

View File

@ -2865,6 +2865,40 @@ public:
{
res = Read1(length, &BinaryStyleTableReader::ReadTblStylePr, this, odocStyle);
}
else if(c_oSer_sts::Style_CustomStyle == type)
{
odocStyle->bCustom = true;
odocStyle->Custom = m_oBufferedStream.GetBool();
}
else if(c_oSer_sts::Style_Aliases == type)
{
odocStyle->Aliases = m_oBufferedStream.GetString3(length);
}
else if(c_oSer_sts::Style_AutoRedefine == type)
{
odocStyle->bautoRedefine = true;
odocStyle->autoRedefine = m_oBufferedStream.GetBool();
}
else if(c_oSer_sts::Style_Locked == type)
{
odocStyle->blocked = true;
odocStyle->locked = m_oBufferedStream.GetBool();
}
else if(c_oSer_sts::Style_Personal == type)
{
odocStyle->bpersonal = true;
odocStyle->personal = m_oBufferedStream.GetBool();
}
else if(c_oSer_sts::Style_PersonalCompose == type)
{
odocStyle->bpersonalCompose = true;
odocStyle->personalCompose = m_oBufferedStream.GetBool();
}
else if(c_oSer_sts::Style_PersonalReply == type)
{
odocStyle->bpersonalReply = true;
odocStyle->personalReply = m_oBufferedStream.GetBool();
}
else
res = c_oSerConstants::ReadUnknown;
return res;

View File

@ -262,7 +262,14 @@ extern int g_nCurFormatVersion;
Style_RowPr = 15,
Style_CellPr = 16,
Style_TblStylePr = 17,
Style_Link = 18
Style_Link = 18,
Style_CustomStyle = 19,
Style_Aliases = 20,
Style_AutoRedefine = 21,
Style_Locked = 22,
Style_Personal = 23,
Style_PersonalCompose = 24,
Style_PersonalReply = 25
};}
namespace c_oSerProp_tblStylePrType{enum c_oSerProp_tblStylePrType
{

View File

@ -2590,6 +2590,48 @@ namespace BinDocxRW
WriteTblStylePr(style.m_arrTblStylePr);
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oCustomStyle.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_CustomStyle);
m_oBcw.m_oStream.WriteBOOL(style.m_oCustomStyle->ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oAliases.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_Aliases);
m_oBcw.m_oStream.WriteStringW3(style.m_oAliases->m_sVal.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(style.m_oAutoRedefine.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_AutoRedefine);
m_oBcw.m_oStream.WriteBOOL(style.m_oAutoRedefine->m_oVal.ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oLocked.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_Locked);
m_oBcw.m_oStream.WriteBOOL(style.m_oLocked->m_oVal.ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oPersonal.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_Personal);
m_oBcw.m_oStream.WriteBOOL(style.m_oPersonal->m_oVal.ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oPersonalCompose.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_PersonalCompose);
m_oBcw.m_oStream.WriteBOOL(style.m_oPersonalCompose->m_oVal.ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
if(style.m_oPersonalReply.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_PersonalReply);
m_oBcw.m_oStream.WriteBOOL(style.m_oPersonalReply->m_oVal.ToBool());
m_oBcw.WriteItemEnd(nCurPos);
}
}
void WriteTblStylePr(const std::vector<OOX::Logic::CTableStyleProperties*>& aProperties)
{

View File

@ -184,7 +184,7 @@ void oox_bar_chart::oox_serialize(std::wostream & _Wostream)
}
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
@ -226,7 +226,7 @@ void oox_line_chart::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
@ -259,7 +259,7 @@ void oox_area_chart::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
@ -289,7 +289,7 @@ void oox_bubble_chart::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
//CP_XML_NODE(L"c:bubbleScale")
@ -326,7 +326,7 @@ void oox_doughnut_chart::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
@ -366,7 +366,7 @@ void oox_pie_chart::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
}
@ -398,7 +398,7 @@ void oox_radar_chart::oox_serialize(std::wostream & _Wostream)
}
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());
@ -436,7 +436,7 @@ void oox_scatter_chart::oox_serialize(std::wostream & _Wostream)
}
CP_XML_NODE(L"c:varyColors")
{
CP_XML_ATTR(L"val", 1);
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
}
oox_serialize_common(CP_XML_STREAM());

View File

@ -67,6 +67,7 @@ public:
is3D_ = false;
type_ = 0;
dispBlanksAs_ = L"zero";
varyColors_ = true;
}
~oox_chart(){}
@ -99,6 +100,7 @@ public:
int type_;
bool is3D_;
bool varyColors_;
std::wstring dispBlanksAs_;
std::vector<int> axisId_; // axId (Axis ID) §21.2.2.9
std::wstring grouping_; // clustered | percentStacked | stacked | standard

View File

@ -382,6 +382,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
if (!current) continue;
if (1 == series_.size())
{
current->varyColors_ = false;
}
current->set_properties(plot_area_.properties_);
current->set_additional_properties(chart_graphic_properties_);
@ -420,7 +425,8 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
formatCode = *strVal;
}
if (domain_cell_range_adress_.empty() == false)
if (domain_cell_range_adress_.empty() == false ||
last_set_type == chart_scatter)
{
if (last_set_type == chart_bubble)
{ //bubble(x)
@ -434,13 +440,19 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
}
else
{ //x
if (!bPivotChart_)
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
current->set_values_series (2, domain_cash);
if (false == domain_cash.empty())
{
if (!bPivotChart_)
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
current->set_values_series (2, domain_cash);
}
//y
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
current->set_values_series (3, cell_cash);
if (false == cell_cash.empty())
{
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
current->set_values_series (3, cell_cash);
}
}
}
else

View File

@ -1055,7 +1055,10 @@ bool odf_drawing_context::isLineShape()
case 48: //SimpleTypes::shapetypeCurvedConnector3:
case 49: //SimpleTypes::shapetypeCurvedConnector4:
case 50: //SimpleTypes::shapetypeCurvedConnector5:
return true;
return true;
case 1000:
if (impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_.get_value_or(draw_fill(draw_fill::solid)).get_type() == draw_fill::none)
return true;
default:
return false;
}

View File

@ -901,6 +901,25 @@ void OoxConverter::convert(PPTX::Logic::Path2D *oox_geom_path)
odf_context()->drawing_context()->set_viewBox(oox_geom_path->w.get_value_or(0), oox_geom_path->h.get_value_or(0));
if (oox_geom_path->fill.IsInit())
{
odf_context()->drawing_context()->start_area_properties();
switch(oox_geom_path->fill->GetBYTECode())
{
case 0://darken
case 1://darkenLess
case 2://lighten
case 3://lightenLess
break;
case 4:
odf_context()->drawing_context()->set_no_fill();
break;
case 5:
default:
break;
}
odf_context()->drawing_context()->end_area_properties();
}
for (size_t i = 0 ; i < oox_geom_path->Paths.size(); i++)
{
if (oox_geom_path->Paths[i].Path2D.is<PPTX::Logic::PathBase>())

View File

@ -25,6 +25,8 @@ include(../OfficeUtils/OfficeUtils.pri)
CONFIG += core_static_link_xml_full
include(../DesktopEditor/xml/build/qt/libxml2.pri)
include(../Common/3dParty/curl/curl.pri)
# DOWNLOADER
HEADERS += \
./FileDownloader/FileDownloader.h \
@ -44,8 +46,6 @@ core_windows {
core_linux {
SOURCES += \
./FileDownloader/FileDownloader_curl.cpp
LIBS += -lcurl
}
core_mac {
OBJECTIVE_SOURCES += \

View File

@ -464,7 +464,7 @@ namespace NSCommon
NSFonts::IFontFile* pFile = pManager->GetFile();
if (pFile)
bIsSymbol = pFile->IsSymbolic(true);
bIsSymbol = pFile->IsSymbolic(false);
std::wstring sFontName = pPair->second.m_sName;

View File

@ -40,21 +40,3 @@ HEADERS += doctrenderer.h \
# downloader
DEFINES += BUIDLER_OPEN_DOWNLOAD_ENABLED
DEFINES += BUIDLER_OPEN_BASE64_ENABLED
HEADERS += ../../Common/FileDownloader/FileDownloader.h
core_windows {
SOURCES += \
../../Common/FileDownloader/FileDownloader_win.cpp
LIBS += -lurlmon
}
core_linux {
SOURCES += \
../../Common/FileDownloader/FileDownloader_curl.cpp
}
core_mac {
OBJECTIVE_SOURCES += \
../../Common/FileDownloader/FileDownloader_mac.mm
LIBS += -framework AppKit
}

View File

@ -541,7 +541,7 @@ namespace NSCommon
if (pManager->GetFile())
{
bIsSymbol = pManager->GetFile()->IsSymbolic(true);
bIsSymbol = pManager->GetFile()->IsSymbolic(false);
}
if (bIsSymbol)

View File

@ -75,7 +75,7 @@ LICENSEMANAGER := $(LIBDIR)/$(LIB_PREFIX)LicenceManager$(LIB_EXT)
OOXMLSIGNATURE := $(LIBDIR)/$(LIB_PREFIX)ooxmlsignature$(LIB_EXT)
HUNSPELL := $(LIBDIR)/$(LIB_PREFIX)hunspell$(SHARED_EXT)
KERNEL := $(LIBDIR)/$(LIB_PREFIX)kernel$(SHARED_EXT)
CRYPTOPP := $(LIBDIR)/$(LIB_PREFIX)cryptopp$(LIB_EXT)
CRYPTOPP := $(LIBDIR)/$(LIB_PREFIX)CryptoPPLib$(LIB_EXT)
TARGETS += $(ALLFONTSGEN)
TARGETS += $(X2T)