[Libreoffice-commits] .: 3 commits - svtools/inc svtools/source tools/inc tools/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Jul 22 02:19:52 PDT 2011
svtools/inc/svtools/filedlg.hxx | 5 --
svtools/source/dialogs/filedlg.cxx | 20 ---------
tools/inc/tools/b3dtrans.hxx | 4 -
tools/inc/tools/errinf.hxx | 2
tools/inc/tools/fsys.hxx | 1
tools/source/fsys/filecopy.cxx | 16 -------
tools/source/generic/b3dtrans.cxx | 50 ------------------------
tools/source/ref/errinf.cxx | 5 --
vcl/unx/generic/gdi/salgdi3.cxx | 61 ++++++++++++++++++++++++------
vcl/unx/generic/gdi/salprnpsp.cxx | 3 -
vcl/unx/generic/printergfx/printerjob.cxx | 5 +-
vcl/unx/generic/printergfx/text_gfx.cxx | 10 +++-
12 files changed, 61 insertions(+), 121 deletions(-)
New commits:
commit d38a00fd56e6a6188e9aded061c30cb41349ac1f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 22 09:19:58 2011 +0100
callcatcher: remove unused methods
diff --git a/svtools/inc/svtools/filedlg.hxx b/svtools/inc/svtools/filedlg.hxx
index aa43f6a..65f8907 100644
--- a/svtools/inc/svtools/filedlg.hxx
+++ b/svtools/inc/svtools/filedlg.hxx
@@ -87,8 +87,6 @@ public:
void SetDefaultExt( const UniString& rExt ) { aDfltExt = rExt; }
const UniString& GetDefaultExt() const { return aDfltExt; }
void AddFilter( const UniString& rFilter, const UniString& rType );
- void RemoveFilter( const UniString& rFilter );
- void RemoveAllFilter();
void SetCurFilter( const UniString& rFilter );
UniString GetCurFilter() const;
sal_uInt16 GetFilterCount() const;
@@ -99,9 +97,6 @@ public:
const Link& GetFileSelectHdl() const { return aFileHdlLink; }
void SetFilterSelectHdl( const Link& rLink ) { aFilterHdlLink = rLink; }
const Link& GetFilterSelectHdl() const { return aFilterHdlLink; }
-
- void SetOkButtonText( const UniString& rText );
- void SetCancelButtonText( const UniString& rText );
};
#endif // _FILEDLG_HXX
diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx
index a2df0ef..37578f7 100644
--- a/svtools/source/dialogs/filedlg.cxx
+++ b/svtools/source/dialogs/filedlg.cxx
@@ -93,16 +93,6 @@ void FileDialog::AddFilter( const UniString& rFilter, const UniString& rMask )
((ImpFileDialog*)pImpFileDlg->GetDialog())->AddFilter( rFilter, rMask );
}
-void FileDialog::RemoveFilter( const UniString& rFilter )
-{
- ((ImpFileDialog*)pImpFileDlg->GetDialog())->RemoveFilter( rFilter );
-}
-
-void FileDialog::RemoveAllFilter()
-{
- ((ImpFileDialog*)pImpFileDlg->GetDialog())->RemoveAllFilter();
-}
-
void FileDialog::SetCurFilter( const UniString& rFilter )
{
((ImpFileDialog*)pImpFileDlg->GetDialog())->SetCurFilter( rFilter );
@@ -138,14 +128,4 @@ UniString FileDialog::GetFilterType( sal_uInt16 nPos ) const
return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos );
}
-void FileDialog::SetOkButtonText( const UniString& rText )
-{
- pImpFileDlg->SetOkButtonText( rText );
-}
-
-void FileDialog::SetCancelButtonText( const UniString& rText )
-{
- pImpFileDlg->SetCancelButtonText( rText );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx
index a9de0b6..db6e725 100644
--- a/tools/inc/tools/b3dtrans.hxx
+++ b/tools/inc/tools/b3dtrans.hxx
@@ -213,10 +213,6 @@ protected:
void PostSetProjection();
void PostSetViewport();
- void CalcMatObjectToDevice();
- void CalcMatFromWorldToView();
- void CalcMatInvTransObjectToEye();
-
virtual void DeviceRectangleChange();
};
diff --git a/tools/inc/tools/errinf.hxx b/tools/inc/tools/errinf.hxx
index 6fa747e..77c9a16 100644
--- a/tools/inc/tools/errinf.hxx
+++ b/tools/inc/tools/errinf.hxx
@@ -210,8 +210,6 @@ private:
protected:
virtual sal_Bool CreateString( const ErrorInfo *,
String &, sal_uInt16& nMask ) const = 0;
- sal_Bool ForwCreateString( const ErrorInfo*,
- String&, sal_uInt16& nMask ) const;
public:
ErrorHandler();
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index bd76d57..6d97612 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -375,7 +375,6 @@ protected:
const DirEntry *pSource, const DirEntry *pTarget );
public:
- FileCopier();
FileCopier( const DirEntry &rSource,
const DirEntry &rTarget );
FileCopier( const FileCopier &rCopier );
diff --git a/tools/source/fsys/filecopy.cxx b/tools/source/fsys/filecopy.cxx
index 4da3fca..7a171a6 100644
--- a/tools/source/fsys/filecopy.cxx
+++ b/tools/source/fsys/filecopy.cxx
@@ -53,22 +53,6 @@
using namespace ::osl;
-/*************************************************************************
-|*
-|* FileCopier::FileCopier()
-|*
-*************************************************************************/
-
-FileCopier::FileCopier() :
-
- nBytesTotal ( 0 ),
- nBytesCopied( 0 ),
- nBlockSize ( 4096 ),
- pImp ( new FileCopier_Impl )
-
-{
-}
-
// -----------------------------------------------------------------------
FileCopier::FileCopier( const DirEntry& rSource, const DirEntry& rTarget ) :
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx
index 96fef35..c38711b 100644
--- a/tools/source/generic/b3dtrans.cxx
+++ b/tools/source/generic/b3dtrans.cxx
@@ -449,56 +449,6 @@ const basegfx::B3DVector& B3dTransformationSet::GetTranslate()
/*************************************************************************
|*
-|* Hilfsmatrixberechnungsroutinen
-|*
-\************************************************************************/
-
-void B3dTransformationSet::CalcMatObjectToDevice()
-{
- // ObjectToDevice berechnen (Orientation * Projection * Object)
- maObjectToDevice = maObjectTrans;
- maObjectToDevice *= maOrientation;
- maObjectToDevice *= GetProjection();
-
- // auf gueltig setzen
- mbObjectToDeviceValid = sal_True;
-}
-
-void B3dTransformationSet::CalcMatInvTransObjectToEye()
-{
- maInvTransObjectToEye = maObjectTrans;
- maInvTransObjectToEye *= maOrientation;
- maInvTransObjectToEye.invert();
- maInvTransObjectToEye.transpose();
-
- // eventuelle Translationen rausschmeissen, da diese
- // Matrix nur zur Transformation von Vektoren gedacht ist
- maInvTransObjectToEye.set(3, 0, 0.0);
- maInvTransObjectToEye.set(3, 1, 0.0);
- maInvTransObjectToEye.set(3, 2, 0.0);
- maInvTransObjectToEye.set(3, 3, 1.0);
-
- // auf gueltig setzen
- mbInvTransObjectToEyeValid = sal_True;
-}
-
-void B3dTransformationSet::CalcMatFromWorldToView()
-{
- maMatFromWorldToView = maOrientation;
- maMatFromWorldToView *= GetProjection();
- const basegfx::B3DVector& rScale(GetScale());
- maMatFromWorldToView.scale(rScale.getX(), rScale.getY(), rScale.getZ());
- const basegfx::B3DVector& rTranslate(GetTranslate());
- maMatFromWorldToView.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ());
- maInvMatFromWorldToView = maMatFromWorldToView;
- maInvMatFromWorldToView.invert();
-
- // gueltig setzen
- mbWorldToViewValid = sal_True;
-}
-
-/*************************************************************************
-|*
|* Direkter Zugriff auf verschiedene Transformationen
|*
\************************************************************************/
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index e010128..e2a170e 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -409,11 +409,6 @@ sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags)
return HandleError_Impl( lId, nFlags, sal_False, aDummy );
}
-sal_Bool ErrorHandler::ForwCreateString(const ErrorInfo* pInfo, String& rStr, sal_uInt16 &rFlags) const
-{
- return ErrHdl_Impl::CreateString(this->pImpl->pNext, pInfo, rStr, rFlags);
-}
-
sal_Bool ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
const ErrorInfo* pInfo, String& pStr,
sal_uInt16 &rFlags)
commit e9f7c2bd0dd77b25dc072dbca1ad87fca58b7dc8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 21 22:57:17 2011 +0100
re-implement original GF_ROTR scaling bug
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 0d5feda..40ab4a2 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -294,6 +294,11 @@ namespace
{
return nRotation != 0;
}
+
+ double toRadian(int nDegree10th)
+ {
+ return (3600 - (nDegree10th)) * M_PI / 1800.0;
+ }
}
void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
@@ -315,10 +320,10 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
switch (aGlyphId & GF_ROTMASK)
{
case GF_ROTL: // left
- glyph_extrarotation.push_back(900);
+ glyph_extrarotation.push_back(1);
break;
case GF_ROTR: // right
- glyph_extrarotation.push_back(-900);
+ glyph_extrarotation.push_back(-1);
break;
default:
glyph_extrarotation.push_back(0);
@@ -407,30 +412,64 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
std::vector<int>::const_iterator aNext = std::find_if(aI+1, aEnd, hasRotation);
+ size_t nStartIndex = std::distance(aStart, aI);
+ size_t nLen = std::distance(aI, aNext);
+
+ cairo_set_font_size(cr, nHeight);
+
cairo_matrix_init_identity(&m);
if (rFont.NeedsArtificialItalic())
m.xy = -m.xx * 0x6000L / 0x10000L;
if (rLayout.GetOrientation())
- cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0);
+ cairo_matrix_rotate(&m, toRadian(rLayout.GetOrientation()));
cairo_matrix_scale(&m, nWidth, nHeight);
if (nGlyphRotation)
{
- cairo_matrix_rotate(&m, (3600 - nGlyphRotation) * M_PI / 1800.0);
+ cairo_matrix_rotate(&m, toRadian(nGlyphRotation*900));
+
+ cairo_matrix_t em_square;
+ cairo_matrix_init_identity(&em_square);
+ cairo_get_matrix(cr, &em_square);
+
+ FT_Face aFace = reinterpret_cast<FT_Face>(pFace);
+ cairo_matrix_scale(&em_square, aFace->units_per_EM,
+ aFace->units_per_EM);
+ cairo_set_matrix(cr, &em_square);
- cairo_font_extents_t extents;
- cairo_font_extents(cr, &extents);
- //gives the same positions as pre-cairo conversion, but I don't like them
- double xdiff = -extents.descent/(extents.height+extents.descent);
- cairo_matrix_translate(&m, xdiff, 1);
+ cairo_font_extents_t font_extents;
+ cairo_font_extents(cr, &font_extents);
+
+ cairo_matrix_init_identity(&em_square);
+ cairo_set_matrix(cr, &em_square);
+
+ //gives the same positions as pre-cairo conversion, but I don't
+ //like them
+ double xdiff = 0.0;
+ double ydiff = 0.0;
+ if (nGlyphRotation == 1)
+ {
+ ydiff = font_extents.ascent/nHeight;
+ xdiff = -font_extents.descent/nHeight;
+ }
+ else if (nGlyphRotation == -1)
+ {
+ cairo_text_extents_t text_extents;
+ cairo_glyph_extents(cr, &cairo_glyphs[nStartIndex], nLen,
+ &text_extents);
+
+ xdiff = -text_extents.x_advance/nHeight;
+ //deliberate bug here for temp render-like-X11-impl,
+ //nWidth should be nHeight below
+ xdiff += font_extents.descent/nWidth;
+ }
+ cairo_matrix_translate(&m, xdiff, ydiff);
}
cairo_set_font_matrix(cr, &m);
- size_t nStartIndex = std::distance(aStart, aI);
- size_t nLen = std::distance(aI, aNext);
cairo_show_glyphs(cr, &cairo_glyphs[nStartIndex], nLen);
#if OSL_DEBUG_LEVEL > 2
commit a2fa953915e2330634a080273090cfdb0a48c135
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 21 13:13:59 2011 +0100
check return of osl_setFilePos
diff --git a/vcl/unx/generic/gdi/salprnpsp.cxx b/vcl/unx/generic/gdi/salprnpsp.cxx
index 7c3b969..abf2ab9 100644
--- a/vcl/unx/generic/gdi/salprnpsp.cxx
+++ b/vcl/unx/generic/gdi/salprnpsp.cxx
@@ -1328,9 +1328,8 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo
{
oslFileHandle pFile = NULL;
osl_openFile( aPDFFiles[i].maTmpURL.pData, &pFile, osl_File_OpenFlag_Read );
- if( pFile )
+ if (pFile && (osl_setFilePos(pFile, osl_Pos_Absolut, 0) == osl_File_E_None))
{
- osl_setFilePos( pFile, osl_Pos_Absolut, 0 );
std::vector< char > buffer( 0x10000, 0 );
// update job data with current page size
Size aPageSize( aPDFFiles[i].maParameters.maPageSize );
diff --git a/vcl/unx/generic/printergfx/printerjob.cxx b/vcl/unx/generic/printergfx/printerjob.cxx
index c6a2261..7ade0a2 100644
--- a/vcl/unx/generic/printergfx/printerjob.cxx
+++ b/vcl/unx/generic/printergfx/printerjob.cxx
@@ -77,13 +77,14 @@ AppendPS (FILE* pDst, osl::File* pSrc, sal_uChar* pBuffer,
if ((pDst == NULL) || (pSrc == NULL))
return sal_False;
+ if (pSrc->setPos(osl_Pos_Absolut, 0) != osl::FileBase::E_None)
+ return sal_False;
+
if (nBlockSize == 0)
nBlockSize = nBLOCKSIZE;
if (pBuffer == NULL)
pBuffer = (sal_uChar*)alloca (nBlockSize);
- pSrc->setPos (osl_Pos_Absolut, 0);
-
sal_uInt64 nIn = 0;
sal_uInt64 nOut = 0;
do
diff --git a/vcl/unx/generic/printergfx/text_gfx.cxx b/vcl/unx/generic/printergfx/text_gfx.cxx
index fd6fac4..623dddb 100644
--- a/vcl/unx/generic/printergfx/text_gfx.cxx
+++ b/vcl/unx/generic/printergfx/text_gfx.cxx
@@ -819,10 +819,14 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppli
convertPfbToPfa (aFontFile, *pFile);
aFontFile.close ();
- pFile->setPos(osl_Pos_Current, -1);
char lastchar = '\n';
- sal_uInt64 uBytes(1);
- pFile->read((void *)(&lastchar), uBytes, uBytes);
+
+ if (pFile->setPos(osl_Pos_Current, -1) == osl::FileBase::E_None)
+ {
+ sal_uInt64 uBytes(1);
+ pFile->read((void *)(&lastchar), uBytes, uBytes);
+ }
+
if (lastchar != '\n')
WritePS (pFile, "\n");
}
More information about the Libreoffice-commits
mailing list