Commit 784c0369 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

баги с конвертацией под мак (Format)

abs -> fabs (где надо)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67646 954022d7-b5bf-4e40-9824-e11837661b57
parent 6e09de60
...@@ -85,8 +85,7 @@ mac { ...@@ -85,8 +85,7 @@ mac {
_LINUX \ _LINUX \
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC
_MAC_NO_APPLE
INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
QMAKE_MAC_SDK = macosx10.11 QMAKE_MAC_SDK = macosx10.11
......
...@@ -90,7 +90,6 @@ mac { ...@@ -90,7 +90,6 @@ mac {
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC \
_MAC_NO_APPLE \
LIBXML_READER_ENABLED LIBXML_READER_ENABLED
INCLUDEPATH += ../../Common/DocxFormat/Source/XML/libxml2/XML/include INCLUDEPATH += ../../Common/DocxFormat/Source/XML/libxml2/XML/include
......
...@@ -40,8 +40,8 @@ void presentation_placeholder::pptx_convert(oox::pptx_conversion_context & Conte ...@@ -40,8 +40,8 @@ void presentation_placeholder::pptx_convert(oox::pptx_conversion_context & Conte
double cy = svg_height_.get_value_or(length(0)).get_value_unit(length::pt); double cy = svg_height_.get_value_or(length(0)).get_value_unit(length::pt);
//ïîêà íå ïîíÿòíî ÷òî çíà÷èò îòðèöàòåëüíàÿ øèðèíà ... //ïîêà íå ïîíÿòíî ÷òî çíà÷èò îòðèöàòåëüíàÿ øèðèíà ...
cx = abs(cx); cx = fabs(cx);
cy = abs(cy); cy = fabs(cy);
double x = svg_x_.get_value_or(length(0)).get_value_unit(length::pt); double x = svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
double y = svg_y_.get_value_or(length(0)).get_value_unit(length::pt); double y = svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
......
...@@ -88,7 +88,6 @@ mac { ...@@ -88,7 +88,6 @@ mac {
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC \
_MAC_NO_APPLE \
LIBXML_READER_ENABLED LIBXML_READER_ENABLED
INCLUDEPATH += ../../Common/DocxFormat/Source/XML/libxml2/XML/include INCLUDEPATH += ../../Common/DocxFormat/Source/XML/libxml2/XML/include
......
...@@ -407,7 +407,7 @@ void odf_drawing_context::end_drawing() ...@@ -407,7 +407,7 @@ void odf_drawing_context::end_drawing()
if (impl_->current_drawing_state_.rotateAngle ) if (impl_->current_drawing_state_.rotateAngle )
rotate += *impl_->current_drawing_state_.rotateAngle; rotate += *impl_->current_drawing_state_.rotateAngle;
if (abs(rotate)>0.001)impl_->current_drawing_state_.rotateAngle = rotate; if (fabs(rotate)>0.001)impl_->current_drawing_state_.rotateAngle = rotate;
} }
double x = impl_->current_drawing_state_.svg_x_ ? impl_->current_drawing_state_.svg_x_->get_value() : 0; double x = impl_->current_drawing_state_.svg_x_ ? impl_->current_drawing_state_.svg_x_->get_value() : 0;
double y = impl_->current_drawing_state_.svg_y_ ? impl_->current_drawing_state_.svg_y_->get_value() : 0; double y = impl_->current_drawing_state_.svg_y_ ? impl_->current_drawing_state_.svg_y_->get_value() : 0;
......
...@@ -323,8 +323,8 @@ bool odf_page_layout_context::add_footer(int type) ...@@ -323,8 +323,8 @@ bool odf_page_layout_context::add_footer(int type)
if (length_cm > 0.01) if (length_cm > 0.01)
{ {
props->style_page_layout_properties_attlist_.common_vertical_margin_attlist_.fo_margin_bottom_ = length_; props->style_page_layout_properties_attlist_.common_vertical_margin_attlist_.fo_margin_bottom_ = length_;
footer_props->style_header_footer_properties_attlist_.svg_height_ = length(abs(length_cm),length::cm);//fo_min_height_ footer_props->style_header_footer_properties_attlist_.svg_height_ = length(fabs(length_cm),length::cm);//fo_min_height_
footer_props->style_header_footer_properties_attlist_.fo_min_height_ = length(abs(length_cm),length::cm); footer_props->style_header_footer_properties_attlist_.fo_min_height_ = length(fabs(length_cm),length::cm);
} }
else if (-length_cm >0.01) else if (-length_cm >0.01)
{ {
...@@ -376,8 +376,8 @@ bool odf_page_layout_context::add_header(int type) ...@@ -376,8 +376,8 @@ bool odf_page_layout_context::add_header(int type)
if (length_cm > 0.01) if (length_cm > 0.01)
{ {
props->style_page_layout_properties_attlist_.common_vertical_margin_attlist_.fo_margin_top_ = length_; props->style_page_layout_properties_attlist_.common_vertical_margin_attlist_.fo_margin_top_ = length_;
header_props->style_header_footer_properties_attlist_.svg_height_ = length(abs(length_cm),length::cm); header_props->style_header_footer_properties_attlist_.svg_height_ = length(fabs(length_cm),length::cm);
header_props->style_header_footer_properties_attlist_.fo_min_height_ = length(abs(length_cm),length::cm);//fo_min_height_ header_props->style_header_footer_properties_attlist_.fo_min_height_ = length(fabs(length_cm),length::cm);//fo_min_height_
} }
else if (-length_cm >0.01) else if (-length_cm >0.01)
{ {
......
...@@ -96,8 +96,7 @@ mac { ...@@ -96,8 +96,7 @@ mac {
_LINUX \ _LINUX \
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC
_MAC_NO_APPLE
INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
} }
......
...@@ -80,7 +80,6 @@ mac { ...@@ -80,7 +80,6 @@ mac {
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC \
_MAC_NO_APPLE \
LIBXML_READER_ENABLED \ LIBXML_READER_ENABLED \
_ASC_USE_UNICODE_CONVERTER_ \ _ASC_USE_UNICODE_CONVERTER_ \
UNICODECONVERTER_USE_DYNAMIC_LIBRARY UNICODECONVERTER_USE_DYNAMIC_LIBRARY
......
...@@ -84,7 +84,6 @@ mac { ...@@ -84,7 +84,6 @@ mac {
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \ MAC \
_MAC_NO_APPLE \
_ASC_USE_UNICODE_CONVERTER_ \ _ASC_USE_UNICODE_CONVERTER_ \
UNICODECONVERTER_USE_DYNAMIC_LIBRARY UNICODECONVERTER_USE_DYNAMIC_LIBRARY
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define STD_BUF_SIZE 1024 #define STD_BUF_SIZE 1024
#endif #endif
int strings_hack_printf_internal(wchar_t* _buffer, size_t _size_alloc, wchar_t* _format, va_list va) static int strings_hack_printf_internal(wchar_t* _buffer, size_t _size_alloc, wchar_t* _format, va_list va)
{ {
size_t write_size = 0; size_t write_size = 0;
...@@ -78,7 +78,7 @@ int strings_hack_printf_internal(wchar_t* _buffer, size_t _size_alloc, wchar_t* ...@@ -78,7 +78,7 @@ int strings_hack_printf_internal(wchar_t* _buffer, size_t _size_alloc, wchar_t*
return (int)write_size; return (int)write_size;
} }
int strings_hack_printf_internal_a(char* _buffer, size_t _size_alloc, char* _format, va_list va) static int strings_hack_printf_internal_a(char* _buffer, size_t _size_alloc, char* _format, va_list va)
{ {
size_t write_size = 0; size_t write_size = 0;
...@@ -147,7 +147,7 @@ int strings_hack_printf_internal_a(char* _buffer, size_t _size_alloc, char* _for ...@@ -147,7 +147,7 @@ int strings_hack_printf_internal_a(char* _buffer, size_t _size_alloc, char* _for
} }
template <typename T> template <typename T>
int strings_hack_printf(T& str, const wchar_t *format, va_list argptr) static int strings_hack_printf(T& str, const wchar_t *format, va_list argptr)
{ {
int buf_size = STD_BUF_SIZE; int buf_size = STD_BUF_SIZE;
...@@ -155,8 +155,9 @@ int strings_hack_printf(T& str, const wchar_t *format, va_list argptr) ...@@ -155,8 +155,9 @@ int strings_hack_printf(T& str, const wchar_t *format, va_list argptr)
if (0 == nFormatLen) if (0 == nFormatLen)
return -1; return -1;
wchar_t* tmp_format = new wchar_t[nFormatLen]; wchar_t* tmp_format = new wchar_t[nFormatLen + 1];
memcpy(tmp_format, format, nFormatLen * sizeof(wchar_t)); memcpy(tmp_format, format, nFormatLen * sizeof(wchar_t));
tmp_format[nFormatLen] = '\0';
while (buf_size < STD_BUF_SIZE * STD_BUF_SIZE) while (buf_size < STD_BUF_SIZE * STD_BUF_SIZE)
{ {
...@@ -179,7 +180,7 @@ int strings_hack_printf(T& str, const wchar_t *format, va_list argptr) ...@@ -179,7 +180,7 @@ int strings_hack_printf(T& str, const wchar_t *format, va_list argptr)
return -1; return -1;
} }
template <typename T> template <typename T>
int strings_hack_printf(T& str, const char* format, va_list argptr) static int strings_hack_printf(T& str, const char* format, va_list argptr)
{ {
int buf_size = STD_BUF_SIZE; int buf_size = STD_BUF_SIZE;
...@@ -187,8 +188,9 @@ int strings_hack_printf(T& str, const char* format, va_list argptr) ...@@ -187,8 +188,9 @@ int strings_hack_printf(T& str, const char* format, va_list argptr)
if (0 == nFormatLen) if (0 == nFormatLen)
return -1; return -1;
char* tmp_format = new char[nFormatLen]; char* tmp_format = new char[nFormatLen + 1];
memcpy(tmp_format, format, nFormatLen * sizeof(char)); memcpy(tmp_format, format, nFormatLen * sizeof(char));
tmp_format[nFormatLen] = '\0';
while (buf_size < STD_BUF_SIZE * STD_BUF_SIZE) while (buf_size < STD_BUF_SIZE * STD_BUF_SIZE)
{ {
...@@ -212,7 +214,7 @@ int strings_hack_printf(T& str, const char* format, va_list argptr) ...@@ -212,7 +214,7 @@ int strings_hack_printf(T& str, const char* format, va_list argptr)
} }
template<typename T, typename CHAR_TYPE> template<typename T, typename CHAR_TYPE>
void strings_hack_printf_exec(T& sRes, const CHAR_TYPE* szFmt, ...) static void strings_hack_printf_exec(T& sRes, const CHAR_TYPE* szFmt, ...)
{ {
va_list argList; va_list argList;
......
...@@ -1045,7 +1045,7 @@ namespace SimpleTypes ...@@ -1045,7 +1045,7 @@ namespace SimpleTypes
int nLen = sValue.GetLength(); int nLen = sValue.GetLength();
if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 ) if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 )
{ {
if ( -1 == nPos ) if ( -1 == nPos && nLen > 0)
{ {
// Поправка 12.1.2.1 Part4 // Поправка 12.1.2.1 Part4
int nValue = (std::min)( 100000, (std::max)( -100000, _wtoi( sValue ) ) ); int nValue = (std::min)( 100000, (std::max)( -100000, _wtoi( sValue ) ) );
...@@ -1945,10 +1945,10 @@ namespace SimpleTypes ...@@ -1945,10 +1945,10 @@ namespace SimpleTypes
if ( -1 == nPos ) if ( -1 == nPos )
{ {
//test //test
double dValue = sValue.IsEmpty() ? 0: _wtof(sValue); double dValue = sValue.IsEmpty() ? 0 : _wtof(sValue);
if (abs(dValue) >= 0 && abs(dValue) <=1 ) if (fabs(dValue) >= 0 && fabs(dValue) <=1 )
{ {
m_dValue = dValue ; m_dValue = dValue;
} }
else else
{ {
...@@ -2105,7 +2105,7 @@ namespace SimpleTypes ...@@ -2105,7 +2105,7 @@ namespace SimpleTypes
int nLen = sValue.GetLength(); int nLen = sValue.GetLength();
if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 ) if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 )
{ {
if ( -1 == nPos ) if ( -1 == nPos && nLen > 0)
{ {
// Поправка 12.1.2.3 (Part4) // Поправка 12.1.2.3 (Part4)
int nValue = (std::max)( 0, (std::min)( 100000, _wtoi( sValue ) ) ); int nValue = (std::max)( 0, (std::min)( 100000, _wtoi( sValue ) ) );
...@@ -2159,7 +2159,7 @@ namespace SimpleTypes ...@@ -2159,7 +2159,7 @@ namespace SimpleTypes
int nLen = sValue.GetLength(); int nLen = sValue.GetLength();
if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 ) if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 )
{ {
if ( -1 == nPos ) if ( -1 == nPos && nLen > 0)
{ {
// Поправка 12.1.2.4 (Part4) // Поправка 12.1.2.4 (Part4)
int nValue = (std::max)( 0, _wtoi( sValue ) ); int nValue = (std::max)( 0, _wtoi( sValue ) );
...@@ -4991,7 +4991,7 @@ namespace SimpleTypes ...@@ -4991,7 +4991,7 @@ namespace SimpleTypes
int nLen = sValue.GetLength(); int nLen = sValue.GetLength();
if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 ) if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 )
{ {
if ( -1 == nPos ) if ( -1 == nPos && nLen > 0)
{ {
// Поправка 12.1.2.5 (Part4) // Поправка 12.1.2.5 (Part4)
int nValue = (std::min)( 100000, (std::max)( 1000, _wtoi( sValue ) ) ); int nValue = (std::min)( 100000, (std::max)( 1000, _wtoi( sValue ) ) );
...@@ -5444,7 +5444,7 @@ namespace SimpleTypes ...@@ -5444,7 +5444,7 @@ namespace SimpleTypes
int nLen = sValue.GetLength(); int nLen = sValue.GetLength();
if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 ) if ( -1 == nPos || nPos != sValue.GetLength() - 1 || nLen <= 0 )
{ {
if ( -1 == nPos ) if ( -1 == nPos && nLen > 0)
{ {
// Поправка 12.1.2.7 (Part4) // Поправка 12.1.2.7 (Part4)
int nValue = (std::min)( 13200000, (std::max)( 0, _wtoi( sValue ) ) ); int nValue = (std::min)( 13200000, (std::max)( 0, _wtoi( sValue ) ) );
......
...@@ -149,6 +149,7 @@ mac { ...@@ -149,6 +149,7 @@ mac {
_LINUX \ _LINUX \
_LINUX_QT \ _LINUX_QT \
_MAC \ _MAC \
MAC \
QT_MAC QT_MAC
LIBS += -L$$V8_CHECKOUT_PATH/out/native -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot LIBS += -L$$V8_CHECKOUT_PATH/out/native -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
......
...@@ -511,7 +511,7 @@ public: ...@@ -511,7 +511,7 @@ public:
{ {
double _center = _x; double _center = _x;
int pen_mw = (int)((m_pRenderer->GetDpiX() * abs(leftMW) * 2 / 25.4) + 0.5); int pen_mw = (int)((m_pRenderer->GetDpiX() * fabs(leftMW) * 2 / 25.4) + 0.5);
if (0 == pen_mw) if (0 == pen_mw)
pen_mw = 1; pen_mw = 1;
...@@ -528,7 +528,7 @@ public: ...@@ -528,7 +528,7 @@ public:
{ {
double _center = _r; double _center = _r;
int pen_mw = (int)((m_pRenderer->GetDpiX() * abs(rightMW) * 2 / 25.4) + 0.5); int pen_mw = (int)((m_pRenderer->GetDpiX() * fabs(rightMW) * 2 / 25.4) + 0.5);
if (0 == pen_mw) if (0 == pen_mw)
pen_mw = 1; pen_mw = 1;
......
...@@ -842,7 +842,7 @@ namespace MetaFile ...@@ -842,7 +842,7 @@ namespace MetaFile
} }
double dDist = sqrt((double)(nX - dX0) * (nX - dX0) + (nY - dY0) * (nY - dY0)); double dDist = sqrt((double)(nX - dX0) * (nX - dX0) + (nY - dY0) * (nY - dY0));
double dRadAngle = asin(abs(nY - dY0) / dDist); double dRadAngle = asin(fabs(nY - dY0) / dDist);
double dAngle = dRadAngle * 180 / 3.14159265358979323846; double dAngle = dRadAngle * 180 / 3.14159265358979323846;
switch (nQuarter) switch (nQuarter)
......
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