Commit 49934d52 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t 2.0.2.395 fix bugs

parent 5c3b05f4
...@@ -752,7 +752,7 @@ void odt_conversion_context::start_note_content() ...@@ -752,7 +752,7 @@ void odt_conversion_context::start_note_content()
{ {
notes_context_.start_note_content(); notes_context_.start_note_content();
office_element_ptr & note_content_element = notes_context_.get_note_content(); office_element_ptr note_content_element = notes_context_.get_note_content();
odf_element_state state = {note_content_element, L"", office_element_ptr(), (int)text_context()->current_level_.size()}; odf_element_state state = {note_content_element, L"", office_element_ptr(), (int)text_context()->current_level_.size()};
text_context()->current_level_.push_back(state); text_context()->current_level_.push_back(state);
......
...@@ -74,7 +74,8 @@ public: ...@@ -74,7 +74,8 @@ public:
{ {
if (para->m_oParagraphProperty->m_oSectPr.IsInit() ) if (para->m_oParagraphProperty->m_oSectPr.IsInit() )
{ {
_section section(RtfSectionPtr( new RtfSection() ), last_section_start, i + 1); RtfSectionPtr s(new RtfSection());
_section section(s, last_section_start, i + 1);
last_section_start = i + 1; last_section_start = i + 1;
...@@ -96,7 +97,8 @@ public: ...@@ -96,7 +97,8 @@ public:
if (last_section.end_para < m_ooxDocument->m_arrItems.size()) if (last_section.end_para < m_ooxDocument->m_arrItems.size())
{ {
_section section(RtfSectionPtr( new RtfSection() ), last_section.end_para, m_ooxDocument->m_arrItems.size()); RtfSectionPtr s(new RtfSection());
_section section(s, last_section.end_para, m_ooxDocument->m_arrItems.size());
section.props->m_oProperty.SetDefaultOOX(); section.props->m_oProperty.SetDefaultOOX();
if (m_ooxDocument->m_oSectPr.IsInit())// свойства последней секции if (m_ooxDocument->m_oSectPr.IsInit())// свойства последней секции
......
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
RtfDocument::RtfDocument() RtfDocument::RtfDocument()
{ {
_section section(RtfSectionPtr(new RtfSection()), 0, 0); RtfSectionPtr s(new RtfSection());
_section section(s, 0, 0);
m_aArray.push_back( section ); m_aArray.push_back( section );
m_oProperty.SetDefaultOOX(); m_oProperty.SetDefaultOOX();
......
...@@ -107,11 +107,27 @@ using namespace ATL; ...@@ -107,11 +107,27 @@ using namespace ATL;
#ifndef _wtof #ifndef _wtof
#include <string>
#define _wtof std::stod #define _wtof std::stod
#define _wtoi std::stoi //#define _wtoi std::stoi
#define _wtoi64(p) std::wcstoll((p),NULL,10) #define _wtoi64(p) std::wcstoll((p),NULL,10)
static int _wtoi(std::wstring sVal)
{
int iVal = 0;
try
{
iVal = std::stod(sVal.c_str());
}catch(...)
{
try
{
iVal = std::wcstoll(sVal.c_str(), NULL, 10);
}catch(...)
{
}
}
return iVal;
}
#ifdef UNICODE #ifdef UNICODE
#define _ttoi _wtoi #define _ttoi _wtoi
#define _tstof _wtof #define _tstof _wtof
......
...@@ -119,7 +119,7 @@ namespace XmlUtils ...@@ -119,7 +119,7 @@ namespace XmlUtils
try try
{ {
return _ttoi(string); return _wtoi(string);
} }
catch(...) catch(...)
{ {
...@@ -139,7 +139,7 @@ namespace XmlUtils ...@@ -139,7 +139,7 @@ namespace XmlUtils
if (string.GetLength() <1) return 0; if (string.GetLength() <1) return 0;
try try
{ {
return (size_t) _ttoi(string); return (size_t) _wtoi(string);
} }
catch(...) catch(...)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
QT -= core QT -= core
QT -= gui QT -= gui
VERSION = 2.0.2.392 VERSION = 2.0.2.395
DEFINES += INTVER=$$VERSION DEFINES += INTVER=$$VERSION
TEMPLATE = app TEMPLATE = app
......
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