From 3c4da71eb001a3116cc9a70136fab4619727a708 Mon Sep 17 00:00:00 2001 From: "Ivan.Shulga" Date: Tue, 28 Oct 2014 11:41:50 +0000 Subject: [PATCH] min->std::min max->std::max git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59232 954022d7-b5bf-4e40-9824-e11837661b57 --- .../Linux/ASCHTMLRendererLib.pro.user | 2 +- .../Linux/ASCOfficeDocxFile2Lib.pro.user | 4 ++-- ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp | 12 ++++++------ ASCOfficePPTXFile/Editor/XmlWriter.h | 2 +- ASCOfficePPTXFile/Editor/imagemanager.h | 8 ++++---- .../PPTXFormat/Logic/Colors/ColorBase.h | 8 ++++---- .../PPTXFormat/Logic/Media/AudioCD.h | 6 +++--- .../PPTXFormat/Presentation/SldSz.h | 6 +++--- .../Linux/PPTXFormatLib/PPTXFormatLib.pro.user | 2 +- .../PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h | 16 ++++++++-------- .../Linux/ASCOfficeUtilsLib.pro.user | 2 +- ASCPresentationEditor/OfficeDrawing/Elements.h | 2 +- .../OfficeDrawing/Shapes/BaseShape/Path.h | 10 +++++----- .../OfficeDrawing/Shapes/Shape.h | 6 +++--- ASCPresentationEditor/OfficeDrawing/XmlWriter.h | 2 +- ASCPresentationEditor/PPTXWriter/CSS.h | 2 +- .../DocxFormatLib/DocxFormatLib.pro.user | 2 +- 17 files changed, 46 insertions(+), 46 deletions(-) diff --git a/ASCHTMLRenderer/Linux/ASCHTMLRendererLib.pro.user b/ASCHTMLRenderer/Linux/ASCHTMLRendererLib.pro.user index 96beb9dc9c..b78a36723a 100644 --- a/ASCHTMLRenderer/Linux/ASCHTMLRendererLib.pro.user +++ b/ASCHTMLRenderer/Linux/ASCHTMLRendererLib.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro.user b/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro.user index 1b4e2ef271..871eb6518b 100644 --- a/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro.user +++ b/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -57,7 +57,7 @@ Desktop Qt 5.3.0 GCC 32bit Desktop Qt 5.3.0 GCC 32bit qt.53.gcc_kit - 0 + 1 0 0 diff --git a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp index 47e4d3176e..ee7aba1c4f 100644 --- a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp +++ b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp @@ -1446,8 +1446,8 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo strStyleAdvenced.Format(_T(";margin-left:%d;margin-top:%d;width:%d;height:%d;polyline_correct:true;"), _x, _y, _r - _x, _b - _y); - double dKoefX = 21600.0 / max(_r - _x, 1); - double dKoefY = 21600.0 / max(_b - _y, 1); + double dKoefX = 21600.0 / (std::max)((_r - _x), 1); + double dKoefY = 21600.0 / (std::max)((_b - _y), 1); CString strPath = _T(""); for (int k = 0; k < nSize; k += 2) { @@ -1882,8 +1882,8 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape) if (oArray.size() >= 2) { - pShape->m_dWidthLogic = max(XmlUtils::GetInteger(oArray[0]), 1); - pShape->m_dHeightLogic = max(XmlUtils::GetInteger(oArray[1]), 1); + pShape->m_dWidthLogic = (std::max)(XmlUtils::GetInteger(oArray[0]), 1); + pShape->m_dHeightLogic = (std::max)(XmlUtils::GetInteger(oArray[1]), 1); } } } @@ -1897,8 +1897,8 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape) if (oArray.size() >= 2) { - pShape->m_dWidthLogic = max(XmlUtils::GetInteger(oArray[0]), 1); - pShape->m_dHeightLogic = max(XmlUtils::GetInteger(oArray[1]), 1); + pShape->m_dWidthLogic = (std::max)(XmlUtils::GetInteger(oArray[0]), 1); + pShape->m_dHeightLogic = (std::max)(XmlUtils::GetInteger(oArray[1]), 1); } } } diff --git a/ASCOfficePPTXFile/Editor/XmlWriter.h b/ASCOfficePPTXFile/Editor/XmlWriter.h index bfd87fd40b..fe032e5ac2 100644 --- a/ASCOfficePPTXFile/Editor/XmlWriter.h +++ b/ASCOfficePPTXFile/Editor/XmlWriter.h @@ -54,7 +54,7 @@ namespace NSBinPptxRW { if (NULL == m_pData) { - m_lSize = max(nSize, 1000); + m_lSize = (std::max)(nSize, (size_t) 1000); m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t)); m_lSizeCur = 0; diff --git a/ASCOfficePPTXFile/Editor/imagemanager.h b/ASCOfficePPTXFile/Editor/imagemanager.h index 669b3ec59f..7f54c694ee 100644 --- a/ASCOfficePPTXFile/Editor/imagemanager.h +++ b/ASCOfficePPTXFile/Editor/imagemanager.h @@ -229,7 +229,7 @@ namespace NSShapeImageGen y -= height; } - return GenerateImageID(punkImage, max(1.0, width), max(1.0, height)); + return GenerateImageID(punkImage, (std::max)(1.0, width), (std::max)(1.0, height)); } CImageInfo WriteImage(const CString& strFile, double& x, double& y, double& width, double& height) { @@ -274,7 +274,7 @@ namespace NSShapeImageGen #endif - return GenerateImageID_2(strDownload, strFile1, max(1.0, width), max(1.0, height)); + return GenerateImageID_2(strDownload, strFile1, (std::max)(1.0, width), (std::max)(1.0, height)); } @@ -288,7 +288,7 @@ namespace NSShapeImageGen if (-1 == width && -1 == height) return GenerateImageID(strFile, width, height); - return GenerateImageID(strFile, max(1.0, width), max(1.0, height)); + return GenerateImageID(strFile, (std::max)(1.0, width), (std::max)(1.0, height)); } void SetFontManager(CFontManager* pFontManager) { @@ -372,7 +372,7 @@ namespace NSShapeImageGen nOutputFormat = _CXIMAGE_FORMAT_PNG; } - LONG lMaxSize = min(max(lWidth, lHeight), m_lMaxSizeImage); + LONG lMaxSize = (std::min)((std::max)(lWidth, lHeight), m_lMaxSizeImage); if (!((lWidth <= lMaxSize) && (lHeight <= lMaxSize))) { diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h index ef12a08ff7..ce549830a4 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h @@ -361,8 +361,8 @@ namespace PPTX //Эти функции использовать для заполнения "origin color" void SetRGB2HSL() { - int iMin = min( red, min(green, blue)); - int iMax = max( red, max(green, blue)); + int iMin = (std::min)( red, (std::min)(green, blue)); + int iMax = (std::max)( red, (std::max)(green, blue)); int iDelta = iMax - iMin; double dMax = ( iMax + iMin )/255.0; double dDelta = iDelta/255.0; @@ -426,8 +426,8 @@ namespace PPTX //Эти использовать при применении модификаторов static void RGB2HSL(unsigned char* RGB, unsigned char* HSL) { - int iMin = min( RGB[0], min(RGB[1], RGB[2])); - int iMax = max( RGB[0], max(RGB[1], RGB[2])); + int iMin = (std::min)( RGB[0], (std::min)(RGB[1], RGB[2])); + int iMax = (std::max)( RGB[0], (std::max)(RGB[1], RGB[2])); int iDelta = iMax - iMin; double dMax = ( iMax + iMin )/255.0; double dDelta = iDelta/255.0; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/AudioCD.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/AudioCD.h index b40399e84f..b8d0442daa 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Media/AudioCD.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Media/AudioCD.h @@ -66,8 +66,8 @@ namespace PPTX AVSINLINE void Normalize() { - stTrack = max(0, min(255, stTrack)); - stTrack = max(0, min(255, endTrack)); + stTrack = (std::max)(0, (std::min)(255, stTrack)); + stTrack = (std::max)(0, (std::min)(255, endTrack)); stTime.normalize_positive(); endTime.normalize_positive(); @@ -76,4 +76,4 @@ namespace PPTX } // namespace Logic } // namespace PPTX -#endif // PPTX_LOGIC_AUDIOCD_INCLUDE_H_ \ No newline at end of file +#endif // PPTX_LOGIC_AUDIOCD_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXFormat/Presentation/SldSz.h b/ASCOfficePPTXFile/PPTXFormat/Presentation/SldSz.h index 0e4b16fc5d..4172f85ae0 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Presentation/SldSz.h +++ b/ASCOfficePPTXFile/PPTXFormat/Presentation/SldSz.h @@ -64,11 +64,11 @@ namespace PPTX AVSINLINE void Normalize() { - cx = min(max(cx, 914400), 51206400); - cy = min(max(cy, 914400), 51206400); + cx = (std::min)((std::max)(cx, 914400), 51206400); + cy = (std::min)((std::max)(cy, 914400), 51206400); } }; } // namespace nsPresentation } // namespace PPTX -#endif // PPTX_PRESENTATION_SLDSZ_INCLUDE_H_ \ No newline at end of file +#endif // PPTX_PRESENTATION_SLDSZ_INCLUDE_H_ diff --git a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro.user b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro.user index 529aab76ee..e4f9a59cd8 100644 --- a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro.user +++ b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h index 047789c114..90f58e156b 100644 --- a/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h +++ b/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h @@ -143,10 +143,10 @@ public: static BOOL Intersect(RectF& c, const RectF& a, const RectF& b) { - REAL right = min(a.GetRight(), b.GetRight()); - REAL bottom = min(a.GetBottom(), b.GetBottom()); - REAL left = max(a.GetLeft(), b.GetLeft()); - REAL top = max(a.GetTop(), b.GetTop()); + REAL right = (std::min)(a.GetRight(), b.GetRight()); + REAL bottom = (std::min)(a.GetBottom(), b.GetBottom()); + REAL left = (std::max)(a.GetLeft(), b.GetLeft()); + REAL top = (std::max)(a.GetTop(), b.GetTop()); c.X = left; c.Y = top; @@ -165,10 +165,10 @@ public: static BOOL Union(RectF& c, const RectF& a, const RectF& b) { - REAL right = max(a.GetRight(), b.GetRight()); - REAL bottom = max(a.GetBottom(), b.GetBottom()); - REAL left = min(a.GetLeft(), b.GetLeft()); - REAL top = min(a.GetTop(), b.GetTop()); + REAL right = (std::max)(a.GetRight(), b.GetRight()); + REAL bottom = (std::max)(a.GetBottom(), b.GetBottom()); + REAL left = (std::min)(a.GetLeft(), b.GetLeft()); + REAL top = (std::min)(a.GetTop(), b.GetTop()); c.X = left; c.Y = top; diff --git a/ASCOfficeUtils/ASCOfficeUtilsLib/Linux/ASCOfficeUtilsLib.pro.user b/ASCOfficeUtils/ASCOfficeUtilsLib/Linux/ASCOfficeUtilsLib.pro.user index 4680f7784b..1dfe4767e9 100644 --- a/ASCOfficeUtils/ASCOfficeUtilsLib/Linux/ASCOfficeUtilsLib.pro.user +++ b/ASCOfficeUtils/ASCOfficeUtilsLib/Linux/ASCOfficeUtilsLib.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/ASCPresentationEditor/OfficeDrawing/Elements.h b/ASCPresentationEditor/OfficeDrawing/Elements.h index 032171972d..5e36220673 100644 --- a/ASCPresentationEditor/OfficeDrawing/Elements.h +++ b/ASCPresentationEditor/OfficeDrawing/Elements.h @@ -1645,7 +1645,7 @@ namespace NSStrings { if (NULL == m_pData) { - m_lSize = max(nSize, 1000); + m_lSize = (std::max)(nSize, (size_t) 1000); m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t)); m_lSizeCur = 0; diff --git a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h index f76de1841d..f8fff13ee4 100644 --- a/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h +++ b/ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/Path.h @@ -302,8 +302,8 @@ namespace NSPresentationEditor double dLeft = pGeomInfo.m_dLeft; double dTop = pGeomInfo.m_dTop; - double dKoefX = max(pGeomInfo.m_dWidth, pGeomInfo.m_dHeight)/ShapeSize;//pGeomInfo.m_dWidth / ShapeSize; - double dKoefY = max(pGeomInfo.m_dWidth, pGeomInfo.m_dHeight)/ShapeSize;//pGeomInfo.m_dHeight / ShapeSize; + double dKoefX = (std::max)(pGeomInfo.m_dWidth, pGeomInfo.m_dHeight)/ShapeSize;//pGeomInfo.m_dWidth / ShapeSize; + double dKoefY = (std::max)(pGeomInfo.m_dWidth, pGeomInfo.m_dHeight)/ShapeSize;//pGeomInfo.m_dHeight / ShapeSize; strRes = _T("