diff --git a/DesktopEditor/common/File.cpp b/DesktopEditor/common/File.cpp index 34dd27f5e8..e0518f13da 100644 --- a/DesktopEditor/common/File.cpp +++ b/DesktopEditor/common/File.cpp @@ -39,14 +39,13 @@ #include #endif -#if defined(__linux__) || defined(_MAC) && !defined(_IOS) +#ifdef _LINUX #include #include #include #endif #ifdef _IOS - #include const char* fileSystemRepresentation(const std::wstring& sFileName); #endif @@ -1443,16 +1442,17 @@ namespace NSFile } CloseHandle(hFile); } -#elif defined(__linux__) || defined(_MAC) && !defined(_IOS) - BYTE* pUtf8 = NULL; - LONG lLen = 0; - CUtf8Converter::GetUtf8StringFromUnicode(inputFile.c_str(), inputFile.length(), pUtf8, lLen, false); - +#else + std::string inputFileA = U_TO_UTF8(inputFile); +#if defined(__linux__) && !defined(_MAC) struct stat attrib; - stat((char*)pUtf8, &attrib); - delete [] pUtf8; - + stat(inputFileA.c_str(), &attrib); result = attrib.st_mtim.tv_nsec; +#else + struct stat attrib; + stat(inputFileA.c_str(), &attrib); + result = (unsigned long)attrib.st_mtimespec.tv_nsec; +#endif #endif return result; } diff --git a/DesktopEditor/doctrenderer/doctrenderer.cpp b/DesktopEditor/doctrenderer/doctrenderer.cpp index 003e9030b0..215a0d3bd5 100644 --- a/DesktopEditor/doctrenderer/doctrenderer.cpp +++ b/DesktopEditor/doctrenderer/doctrenderer.cpp @@ -550,6 +550,20 @@ namespace NSDoctRenderer if (js_func_calculate->IsFunction()) { v8::Handle func_calculate = v8::Handle::Cast(js_func_calculate); + + if (pParams->m_sJsonParams.empty()) + args[0] = v8::Undefined(isolate); + else + { + std::string sTmp = U_TO_UTF8((pParams->m_sJsonParams)); + + #ifndef V8_OS_XP + args[0] = v8::JSON::Parse(context, v8::String::NewFromUtf8(isolate, (char*)sTmp.c_str())).FromMaybe(v8::Local()); + #else + args[0] = v8::JSON::Parse(v8::String::NewFromUtf8(isolate, (char*)sTmp.c_str())); + #endif + } + func_calculate->Call(js_objectApi, 1, args); if (try_catch.HasCaught()) diff --git a/DesktopEditor/graphics/Graphics.cpp b/DesktopEditor/graphics/Graphics.cpp index 149d8bf835..41c5ccdb37 100644 --- a/DesktopEditor/graphics/Graphics.cpp +++ b/DesktopEditor/graphics/Graphics.cpp @@ -620,8 +620,24 @@ namespace Aggplus if (DashStyleCustom == eStyle) { - if (0 == pPen->Count) + if (0 == pPen->Count || NULL == pPen->DashPattern) + { eStyle = DashStyleSolid; + } + else + { + bool bFoundNormal = false; + for (int i = 0; i < pPen->Count; i++) + { + if (fabs(pPen->DashPattern[i]) > 0.0001) + { + bFoundNormal = true; + break; + } + } + if (!bFoundNormal) + eStyle = DashStyleSolid; + } } agg::trans_affine* pAffine = &m_oFullTransform.m_internal->m_agg_mtx; @@ -710,7 +726,10 @@ namespace Aggplus break; } } - + + if ((0 == dWidth && !m_bIntegerGrid) || dWidth < dWidthMinSize) + dWidth = dWidthMinSize; + pgD.line_cap(LineCap); pgD.line_join(LineJoin); pgD.miter_limit(dblMiterLimit);