mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 01:04:34 +08:00
Fix connections conversion
This commit is contained in:
@ -712,7 +712,7 @@ namespace OOX
|
||||
{
|
||||
if(i->m_sUri == L"{DE250136-89BD-433C-8126-D09CA5730AF9}")
|
||||
{
|
||||
ptr->m_EXTCONN15 = i->m_oConnection->toBin();
|
||||
ptr->m_EXTCONN15 = i->m_oConnection->toBin15();
|
||||
}
|
||||
}
|
||||
return XLS::BaseObjectPtr{ptr};
|
||||
|
||||
@ -318,7 +318,12 @@ namespace OOX
|
||||
{
|
||||
auto ptr(new XLSB::RangePr15);
|
||||
if(m_oSourceName.IsInit())
|
||||
ptr->irstSourceName = m_oSourceName.get();
|
||||
{
|
||||
auto tempStr = m_oSourceName.get();
|
||||
ptr->irstSourceName = tempStr.substr(0, tempStr.size()-2);
|
||||
}
|
||||
else
|
||||
ptr->irstSourceName.setSize(0xFFFFFFFF);
|
||||
return XLS::BaseObjectPtr{ptr};
|
||||
}
|
||||
EElementType CRangePr::getType() const
|
||||
@ -378,14 +383,29 @@ namespace OOX
|
||||
{
|
||||
auto ptr1(new XLSB::ECDBPROPS);
|
||||
auto ptr(new XLSB::BeginECDbProps);
|
||||
ptr1->m_BrtBeginECDbProps = XLS::BaseObjectPtr{ptr};
|
||||
if(m_oConnection.IsInit())
|
||||
ptr->stConn = m_oConnection.get();
|
||||
else
|
||||
ptr->stConn = false;
|
||||
if(m_oCommand.IsInit())
|
||||
ptr->stCmd = m_oCommand.get();
|
||||
else
|
||||
{
|
||||
ptr->stCmd = false;
|
||||
ptr->fLoadCmd = false;
|
||||
}
|
||||
if(m_oServerCommand.IsInit())
|
||||
ptr->stCmdSvr = m_oServerCommand.get();
|
||||
else
|
||||
{
|
||||
ptr->fLoadCmdSvr = false;
|
||||
ptr->stCmdSvr = false;
|
||||
}
|
||||
if(m_oCommandType.IsInit())
|
||||
ptr->icmdtype = m_oCommandType.get();
|
||||
else
|
||||
ptr->icmdtype = 0;
|
||||
return XLS::BaseObjectPtr{ptr1};
|
||||
}
|
||||
EElementType CDbPr::getType() const
|
||||
@ -491,15 +511,15 @@ namespace OOX
|
||||
if(m_oServerNumberFormat.IsInit())
|
||||
ptr->fSrvFmtNum = m_oServerNumberFormat.get();
|
||||
else
|
||||
ptr->fSrvFmtNum = false;
|
||||
ptr->fSrvFmtNum = true;
|
||||
if(m_oServerFont.IsInit())
|
||||
ptr->fSrvFmtFlags = m_oServerFont.get();
|
||||
else
|
||||
ptr->fSrvFmtFlags = false;
|
||||
ptr->fSrvFmtFlags = true;
|
||||
if(m_oServerFontColor.IsInit())
|
||||
ptr->fSrvFmtFore = m_oServerFontColor.get();
|
||||
else
|
||||
ptr->fSrvFmtFore = false;
|
||||
ptr->fSrvFmtFore = true;
|
||||
return XLS::BaseObjectPtr{ptr1};
|
||||
}
|
||||
EElementType COlapPr::getType() const
|
||||
@ -981,6 +1001,31 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
XLS::BaseObjectPtr CConnection::toBin15()
|
||||
{
|
||||
XLS::BaseObjectPtr objectPtr;
|
||||
|
||||
auto ptr(new XLSB::EXTCONN15);
|
||||
objectPtr = XLS::BaseObjectPtr{ptr};
|
||||
auto ptr1(new XLSB::BeginExtConn15);
|
||||
ptr1->fAutoDelete = false;
|
||||
ptr1->fExcludeFromRefreshAll = false;
|
||||
ptr1->fSandbox = false;
|
||||
ptr1->fUsedByAddin = false;
|
||||
if(m_oIdExt.IsInit() && !m_oIdExt.get().empty())
|
||||
ptr1->irstId = m_oIdExt.get();
|
||||
else
|
||||
{
|
||||
ptr1->fSandbox = true;
|
||||
ptr1->irstId.setSize(0xFFFFFFFF);
|
||||
}
|
||||
|
||||
ptr->m_BrtBeginExtConn15 = XLS::BaseObjectPtr{ptr1};
|
||||
if(m_oRangePr.IsInit())
|
||||
ptr->m_source = m_oRangePr->toBin();
|
||||
return objectPtr;
|
||||
|
||||
}
|
||||
XLS::BaseObjectPtr CConnection::toBin()
|
||||
{
|
||||
XLS::BaseObjectPtr objectPtr;
|
||||
@ -1021,12 +1066,16 @@ namespace OOX
|
||||
|
||||
if(m_oType.IsInit())
|
||||
ptr1->idbtype = m_oType.get();
|
||||
else
|
||||
ptr1->idbtype = 0;
|
||||
if(m_oName.IsInit())
|
||||
ptr1->stConnName = m_oName.get();
|
||||
else
|
||||
ptr1->stConnName = L"";
|
||||
if(m_oId.IsInit())
|
||||
ptr1->dwConnID = m_oId->GetValue();
|
||||
else
|
||||
ptr1->dwConnID = 1;
|
||||
if(m_oCredentials.IsInit())
|
||||
ptr1->iCredMethod = m_oCredentials->GetValue();
|
||||
else
|
||||
@ -1081,10 +1130,12 @@ namespace OOX
|
||||
ptr1->fRefreshOnLoad = false;
|
||||
if(m_oSaveData.IsInit())
|
||||
ptr1->fSaveData = m_oSaveData.get();
|
||||
else
|
||||
ptr1->fSaveData = false;
|
||||
if(m_oSavePassword.IsInit())
|
||||
ptr1->pc = m_oSavePassword.get();
|
||||
else
|
||||
ptr1->pc = 0;
|
||||
ptr1->pc = 2;
|
||||
if(m_oSingleSignOnId.IsInit())
|
||||
ptr1->stSso = m_oSingleSignOnId.get();
|
||||
else
|
||||
|
||||
@ -328,6 +328,7 @@ namespace OOX
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void fromBin(XLS::BaseObjectPtr& obj);
|
||||
XLS::BaseObjectPtr toBin();
|
||||
XLS::BaseObjectPtr toBin15();
|
||||
|
||||
virtual EElementType getType() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user