Commit 4f111fba authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

1.0.0.3 Исправлен баг с клипом и с прозрачностью.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64111 954022d7-b5bf-4e40-9824-e11837661b57
parent 2ebf7bee
...@@ -623,7 +623,6 @@ namespace NSOnlineOfficeBinToPdf ...@@ -623,7 +623,6 @@ namespace NSOnlineOfficeBinToPdf
{ {
if (bIsPathOpened) if (bIsPathOpened)
{ {
pPdf->PathCommandEnd();
pPdf->EndCommand(4); pPdf->EndCommand(4);
bIsPathOpened = false; bIsPathOpened = false;
} }
......
...@@ -303,7 +303,7 @@ void CPdfRenderer::CCommandManager::Flush() ...@@ -303,7 +303,7 @@ void CPdfRenderer::CCommandManager::Flush()
if (!pText) if (!pText)
continue; continue;
if (pTextFont != pText->GetFont() || abs(dTextSize - pText->GetSize()) > 0.001) if (pTextFont != pText->GetFont() || fabs(dTextSize - pText->GetSize()) > 0.001)
{ {
oTextLine.Flush(pPage); oTextLine.Flush(pPage);
pTextFont = pText->GetFont(); pTextFont = pText->GetFont();
...@@ -326,7 +326,7 @@ void CPdfRenderer::CCommandManager::Flush() ...@@ -326,7 +326,7 @@ void CPdfRenderer::CCommandManager::Flush()
pPage->SetFillAlpha(nTextAlpha); pPage->SetFillAlpha(nTextAlpha);
} }
if (abs(dTextSpace - pText->GetSpace()) > 0.001) if (fabs(dTextSpace - pText->GetSpace()) > 0.001)
{ {
oTextLine.Flush(pPage); oTextLine.Flush(pPage);
dTextSpace = pText->GetSpace(); dTextSpace = pText->GetSpace();
...@@ -340,7 +340,7 @@ void CPdfRenderer::CCommandManager::Flush() ...@@ -340,7 +340,7 @@ void CPdfRenderer::CCommandManager::Flush()
pPage->SetTextRenderingMode(eMode); pPage->SetTextRenderingMode(eMode);
} }
if (abs(dHorScaling - pText->GetHorScaling()) > 0.001) if (fabs(dHorScaling - pText->GetHorScaling()) > 0.001)
{ {
oTextLine.Flush(pPage); oTextLine.Flush(pPage);
dHorScaling = pText->GetHorScaling(); dHorScaling = pText->GetHorScaling();
...@@ -819,7 +819,7 @@ HRESULT CPdfRenderer::get_FontSize(double* dSize) ...@@ -819,7 +819,7 @@ HRESULT CPdfRenderer::get_FontSize(double* dSize)
} }
HRESULT CPdfRenderer::put_FontSize(const double& dSize) HRESULT CPdfRenderer::put_FontSize(const double& dSize)
{ {
if (abs(dSize - m_oFont.GetSize()) > 0.001) if (fabs(dSize - m_oFont.GetSize()) > 0.001)
{ {
m_oFont.SetSize(dSize); m_oFont.SetSize(dSize);
m_bNeedUpdateTextSize = true; m_bNeedUpdateTextSize = true;
...@@ -857,7 +857,7 @@ HRESULT CPdfRenderer::get_FontCharSpace(double* dSpace) ...@@ -857,7 +857,7 @@ HRESULT CPdfRenderer::get_FontCharSpace(double* dSpace)
} }
HRESULT CPdfRenderer::put_FontCharSpace(const double& dSpace) HRESULT CPdfRenderer::put_FontCharSpace(const double& dSpace)
{ {
if (abs(dSpace - m_oFont.GetCharSpace()) > 0.001) if (fabs(dSpace - m_oFont.GetCharSpace()) > 0.001)
{ {
m_oFont.SetCharSpace(dSpace); m_oFont.SetCharSpace(dSpace);
m_bNeedUpdateTextCharSpace = true; m_bNeedUpdateTextCharSpace = true;
...@@ -933,7 +933,7 @@ HRESULT CPdfRenderer::CommandDrawText(const std::wstring& wsUnicodeText, const d ...@@ -933,7 +933,7 @@ HRESULT CPdfRenderer::CommandDrawText(const std::wstring& wsUnicodeText, const d
pText->SetFont(m_pFont); pText->SetFont(m_pFont);
pText->SetSize(dFontSize); pText->SetSize(dFontSize);
pText->SetMode(textrenderingmode_Invisible); pText->SetMode(textrenderingmode_Invisible);
if (abs(dStringWidth) > 0.001) if (fabs(dStringWidth) > 0.001)
pText->SetHorScaling(dResultWidth / dStringWidth * 100); pText->SetHorScaling(dResultWidth / dStringWidth * 100);
return S_OK; return S_OK;
......
...@@ -400,11 +400,11 @@ private: ...@@ -400,11 +400,11 @@ private:
std::vector<double> vPattern; std::vector<double> vPattern;
for (LONG lIndex = 0; lIndex < lSize; lIndex++) for (LONG lIndex = 0; lIndex < lSize; lIndex++)
{ {
if (lIndex > 1 && abs(pPattern[lIndex]) < 0.001) if (lIndex > 1 && fabs(pPattern[lIndex]) < 0.001)
{ {
if (0 == lIndex % 2) if (0 == lIndex % 2)
{ {
if (abs(pPattern[lIndex + 1]) < 0.001) if (fabs(pPattern[lIndex + 1]) < 0.001)
{ {
lIndex++; lIndex++;
} }
...@@ -864,7 +864,7 @@ private: ...@@ -864,7 +864,7 @@ private:
LONG lColor2 = oPoint2.lColor; LONG lColor2 = oPoint2.lColor;
double dDiff = dPoint2 - dPoint1; double dDiff = dPoint2 - dPoint1;
if (abs(dDiff) < 0) if (fabs(dDiff) < 0)
return lColor1; return lColor1;
TColor oColor1 = lColor1; TColor oColor1 = lColor1;
...@@ -1346,12 +1346,12 @@ private: ...@@ -1346,12 +1346,12 @@ private:
} }
bool IsIdentity() const bool IsIdentity() const
{ {
if (abs(m11 - 1) < 0.001 if (fabs(m11 - 1) < 0.001
&& abs(m12) < 0.001 && fabs(m12) < 0.001
&& abs(m21) < 0.001 && fabs(m21) < 0.001
&& abs(m22 - 1) < 0.001 && fabs(m22 - 1) < 0.001
&& abs(dx) < 0.001 && fabs(dx) < 0.001
&& abs(dy) < 0.001) && fabs(dy) < 0.001)
return true; return true;
return false; return false;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
QT -= core gui QT -= core gui
VERSION = 1.0.0.2 VERSION = 1.0.0.3
TARGET = PdfWriter TARGET = PdfWriter
TEMPLATE = lib TEMPLATE = lib
......
...@@ -352,7 +352,7 @@ namespace PdfWriter ...@@ -352,7 +352,7 @@ namespace PdfWriter
{ {
pExtGrState = m_vStrokeAlpha.at(unIndex); pExtGrState = m_vStrokeAlpha.at(unIndex);
if (abs(dAlpha - pExtGrState->GetAlphaStroke()) < 0.001) if (fabs(dAlpha - pExtGrState->GetAlphaStroke()) < 0.001)
return pExtGrState; return pExtGrState;
} }
...@@ -371,7 +371,7 @@ namespace PdfWriter ...@@ -371,7 +371,7 @@ namespace PdfWriter
{ {
pExtGrState = m_vFillAlpha.at(unIndex); pExtGrState = m_vFillAlpha.at(unIndex);
if (abs(dAlpha - pExtGrState->GetAlphaFill()) < 0.001) if (fabs(dAlpha - pExtGrState->GetAlphaFill()) < 0.001)
return pExtGrState; return pExtGrState;
} }
......
...@@ -1299,7 +1299,7 @@ namespace PdfWriter ...@@ -1299,7 +1299,7 @@ namespace PdfWriter
} }
else else
{ {
if (abs(dY - m_dStartY) > 0.001 || abs(dX - m_dCurX) > 0.01) if (fabs(dY - m_dStartY) > 0.001 || fabs(dX - m_dCurX) > 0.01)
return false; return false;
m_pText[m_nIndex * 2 + 0] = pCodes[0]; m_pText[m_nIndex * 2 + 0] = pCodes[0];
...@@ -1338,7 +1338,7 @@ namespace PdfWriter ...@@ -1338,7 +1338,7 @@ namespace PdfWriter
return true; return true;
} }
if (abs(dY - m_dY) > 0.001) if (fabs(dY - m_dY) > 0.001)
return false; return false;
CTextWord* pLastText = m_vWords.at(m_vWords.size() - 1); CTextWord* pLastText = m_vWords.at(m_vWords.size() - 1);
......
...@@ -275,7 +275,7 @@ namespace PdfWriter ...@@ -275,7 +275,7 @@ namespace PdfWriter
if (pColors[3 * nIndex + 0] != m_pColors[3 * nIndex + 0] if (pColors[3 * nIndex + 0] != m_pColors[3 * nIndex + 0]
|| pColors[3 * nIndex + 1] != m_pColors[3 * nIndex + 1] || pColors[3 * nIndex + 1] != m_pColors[3 * nIndex + 1]
|| pColors[3 * nIndex + 2] != m_pColors[3 * nIndex + 2] || pColors[3 * nIndex + 2] != m_pColors[3 * nIndex + 2]
|| abs(pPoints[nIndex] - m_pColorsPoints[nIndex]) > 0.01) || fabs(pPoints[nIndex] - m_pColorsPoints[nIndex]) > 0.01)
return false; return false;
} }
} }
...@@ -284,7 +284,7 @@ namespace PdfWriter ...@@ -284,7 +284,7 @@ namespace PdfWriter
for (int nIndex = 0; nIndex < nCount; nIndex++) for (int nIndex = 0; nIndex < nCount; nIndex++)
{ {
if (pColors[nIndex] != m_pColors[nIndex] if (pColors[nIndex] != m_pColors[nIndex]
|| abs(pPoints[nIndex] - m_pColorsPoints[nIndex]) > 0.01) || fabs(pPoints[nIndex] - m_pColorsPoints[nIndex]) > 0.01)
return false; return false;
} }
} }
...@@ -322,10 +322,10 @@ namespace PdfWriter ...@@ -322,10 +322,10 @@ namespace PdfWriter
} }
bool CAxialShading::Compare(double dX0, double dY0, double dX1, double dY1) bool CAxialShading::Compare(double dX0, double dY0, double dX1, double dY1)
{ {
if (abs(dX0 - m_dX0) > 0.01 if (fabs(dX0 - m_dX0) > 0.01
|| abs(dY0 - m_dY0) > 0.01 || fabs(dY0 - m_dY0) > 0.01
|| abs(dX1 - m_dX1) > 0.01 || fabs(dX1 - m_dX1) > 0.01
|| abs(dY1 - m_dY1) > 0.01) || fabs(dY1 - m_dY1) > 0.01)
return false; return false;
return true; return true;
...@@ -358,12 +358,12 @@ namespace PdfWriter ...@@ -358,12 +358,12 @@ namespace PdfWriter
} }
bool CRadialShading::Compare(double dX0, double dY0, double dR0, double dX1, double dY1, double dR1) bool CRadialShading::Compare(double dX0, double dY0, double dR0, double dX1, double dY1, double dR1)
{ {
if (abs(dX0 - m_dX0) > 0.01 if (fabs(dX0 - m_dX0) > 0.01
|| abs(dY0 - m_dY0) > 0.01 || fabs(dY0 - m_dY0) > 0.01
|| abs(dR0 - m_dR0) > 0.01 || fabs(dR0 - m_dR0) > 0.01
|| abs(dX1 - m_dX1) > 0.01 || fabs(dX1 - m_dX1) > 0.01
|| abs(dY1 - m_dY1) > 0.01 || fabs(dY1 - m_dY1) > 0.01
|| abs(dR1 - m_dR1) > 0.01) || fabs(dR1 - m_dR1) > 0.01)
return false; return false;
return true; return true;
......
...@@ -108,7 +108,7 @@ namespace PdfWriter ...@@ -108,7 +108,7 @@ namespace PdfWriter
void CStream::WriteInt(int nValue) void CStream::WriteInt(int nValue)
{ {
//int nLen = 0; //int nLen = 0;
//const char* sString = NSFastIntToString::GetString(abs(nValue), nLen); //const char* sString = NSFastIntToString::GetString(fabs(nValue), nLen);
//if (sString) //if (sString)
//{ //{
// if (nValue < 0) // if (nValue < 0)
...@@ -148,10 +148,10 @@ namespace PdfWriter ...@@ -148,10 +148,10 @@ namespace PdfWriter
void CStream::WriteReal(double dValue) void CStream::WriteReal(double dValue)
{ {
//int nIVal = (int)dValue; //int nIVal = (int)dValue;
//int nFVal = (int)(abs(dValue - nIVal) * 10000); //int nFVal = (int)(fabs(dValue - nIVal) * 10000);
//int nLen = 0; //int nLen = 0;
//const char* sString = NSFastIntToString::GetString(abs(nIVal), nLen); //const char* sString = NSFastIntToString::GetString(fabs(nIVal), nLen);
//if (nIVal < 0) //if (nIVal < 0)
// WriteChar('-'); // WriteChar('-');
...@@ -172,10 +172,10 @@ namespace PdfWriter ...@@ -172,10 +172,10 @@ namespace PdfWriter
//char pBuffer[32]; //char pBuffer[32];
//int nResLen = 0; //int nResLen = 0;
//int nIVal = (int)dValue; //int nIVal = (int)dValue;
//int nFVal = (int)(abs(dValue - nIVal) * 10000); //int nFVal = (int)(fabs(dValue - nIVal) * 10000);
//int nLen = 0; //int nLen = 0;
//const char* sString = NSFastIntToString::GetString(abs(nIVal), nLen); //const char* sString = NSFastIntToString::GetString(fabs(nIVal), nLen);
//if (nIVal < 0) //if (nIVal < 0)
// pBuffer[nResLen++] = '-'; // pBuffer[nResLen++] = '-';
......
...@@ -73,12 +73,12 @@ namespace PdfWriter ...@@ -73,12 +73,12 @@ namespace PdfWriter
} }
bool IsIdentity() const bool IsIdentity() const
{ {
if (abs(m11 - 1) < 0.001 if (fabs(m11 - 1) < 0.001
&& abs(m12) < 0.001 && fabs(m12) < 0.001
&& abs(m21) < 0.001 && fabs(m21) < 0.001
&& abs(m22 - 1) < 0.001 && fabs(m22 - 1) < 0.001
&& abs(x) < 0.001 && fabs(x) < 0.001
&& abs(y) < 0.001) && fabs(y) < 0.001)
return true; return true;
return false; return false;
...@@ -93,12 +93,12 @@ namespace PdfWriter ...@@ -93,12 +93,12 @@ namespace PdfWriter
} }
bool operator==(const CMatrix& oMatrix) bool operator==(const CMatrix& oMatrix)
{ {
if (abs(oMatrix.m11 - m11) > 0.001 if (fabs(oMatrix.m11 - m11) > 0.001
|| abs(oMatrix.m12 - m12) > 0.001 || fabs(oMatrix.m12 - m12) > 0.001
|| abs(oMatrix.m21 - m21) > 0.001 || fabs(oMatrix.m21 - m21) > 0.001
|| abs(oMatrix.m22 - m22) > 0.001 || fabs(oMatrix.m22 - m22) > 0.001
|| abs(oMatrix.x - x) > 0.001 || fabs(oMatrix.x - x) > 0.001
|| abs(oMatrix.y - y) > 0.001) || fabs(oMatrix.y - y) > 0.001)
return false; return false;
return true; return true;
......
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