Various Clang 3.1 -Wunsued-variable, -Wconstant-conversion

Change-Id: I0799f22685609201dfb524c373d065b6184ed53c
This commit is contained in:
Stephan Bergmann 2012-07-17 17:00:14 +02:00
parent 7dde426915
commit 4dd7c0369d
31 changed files with 23 additions and 70 deletions

View File

@ -507,7 +507,6 @@ sal_Bool BasicIDEShell::NextPage( sal_Bool bPrev )
void BasicIDEShell::ArrangeTabBar()
{
Size aSz( GetViewFrame()->GetWindow().GetOutputSizePixel() );
long nBoxPos = aScrollBarBox.GetPosPixel().X() - 1;
long nPos = pTabBar->GetSplitSize();
if ( nPos <= nBoxPos )

View File

@ -38,7 +38,6 @@ SchLayoutTabPage::SchLayoutTabPage(Window* pWindow,const SfxItemSet& rInAttrs)
: SfxTabPage(pWindow, SchResId(TP_LAYOUT), rInAttrs)
, m_pGeometryResources(0)
{
Size aPageSize( this->GetSizePixel() );
Point aPos( this->LogicToPixel( Point(6,6), MapMode(MAP_APPFONT) ) );
m_pGeometryResources = new BarGeometryResources( this );
m_pGeometryResources->SetPosPixel( aPos );

View File

@ -405,8 +405,6 @@ APPHELPER_XSERVICEINFO_IMPL(ChartController,CHART_CONTROLLER_SERVICE_IMPLEMENTAT
m_apDropTargetHelper.reset();
}
{
awt::Size aPageSize( ChartModelHelper::getPageSize(getModel()) );
// calls to VCL
SolarMutexGuard aSolarGuard;
m_pChartWindow = new ChartWindow(this,pParent,pParent?pParent->GetStyle():0);

View File

@ -757,8 +757,6 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl:
//-------------------------------------------------------------
//convert properties to ItemSet
awt::Size aPageSize( ChartModelHelper::getPageSize(getModel()) );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< ReferenceSizeProvider > pRefSizeProv(
impl_createReferenceSizeProvider());

View File

@ -1456,7 +1456,6 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer&
bool bLessSpaceConsumedThanExpected = false;
{
::basegfx::B2IRectangle aOldRect( aConsumedOuterRect );
aConsumedOuterRect = ShapeFactory::getRectangleOfShape(xBoundingShape);
if( aConsumedOuterRect.getMinX() > aAvailableOuterRect.getMinX()
|| aConsumedOuterRect.getMaxX() < aAvailableOuterRect.getMaxX()

View File

@ -176,9 +176,10 @@ namespace cppcanvas
aPolygon.clear ();
// debug code
const ::basegfx::B2DRectangle aBounds (::basegfx::tools::getRange (GetPolygon (rR)));
EMFP_DEBUG (printf ("EMF+\tpolygon bounding box: %f,%f %fx%f (mapped)\n", aBounds.getMinX (), aBounds.getMinY (), aBounds.getWidth (), aBounds.getHeight ()));
(void) rR; // avoid warnings
EMFP_DEBUG (
const ::basegfx::B2DRectangle aBounds (::basegfx::tools::getRange (GetPolygon (rR)));
printf ("EMF+\tpolygon bounding box: %f,%f %fx%f (mapped)\n", aBounds.getMinX (), aBounds.getMinY (), aBounds.getWidth (), aBounds.getHeight ()));
}
::basegfx::B2DPolyPolygon& GetPolygon (ImplRenderer& rR, bool bMapIt = true)

View File

@ -2573,7 +2573,6 @@ namespace cppcanvas
const OutDevState& rState( rStates.getState() );
const ::Size aBaselineOffset( tools::getBaselineOffset( rState,
rVDev ) );
const ::Point aStartPoint( pAct->GetStartPoint() );
const ::basegfx::B2DSize aSize( rState.mapModeTransform *
::basegfx::B2DSize(pAct->GetWidth(),
0 ));
@ -2980,8 +2979,6 @@ namespace cppcanvas
const Size aMtfSize( rMtf.GetPrefSize() );
const Size aMtfSizePixPre( aVDev.LogicToPixel( aMtfSize,
rMtf.GetPrefMapMode() ) );
const Point aEmptyPt;
const Point aMtfOriginPix( aVDev.LogicToPixel( aEmptyPt ) );
// #i44110# correct null-sized output - there are shapes
// which have zero size in at least one dimension

View File

@ -1515,8 +1515,6 @@ void SvxPositionSizeTabPage::PointChanged( Window* pWindow, RECT_POINT eRP )
else
{
meRP = eRP;
Rectangle aTmpRect( GetRect() );
SetMinMaxPosition();
}
}

View File

@ -373,7 +373,6 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect,
{
DBG_CHKTHIS(OTableEditorCtrl,NULL);
const String aText( GetCellText( m_nCurrentPos, nColumnId ));
const Point aPos(rRect.TopLeft());
const Size TxtSize(GetDataWindow().GetTextWidth(aText), GetDataWindow().GetTextHeight());
rDev.Push( PUSH_CLIPREGION );

View File

@ -592,7 +592,7 @@ private:
EditPaM StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
EditPaM EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES );
EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_Bool bAcceptStartOfWord = sal_True );
EditSelection SelectSentence( const EditSelection& rCurSel );
EditSelection SelectSentence( const EditSelection& rCurSel ) const;
EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bToLeft );
EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart );
@ -670,7 +670,7 @@ private:
::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const;
::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker() const;
SpellInfo * CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs );
SpellInfo * CreateSpellInfo( bool bMultipleDocs );
ImpEditEngine(); // disabled
ImpEditEngine(EditEngine* pEditEngine, SfxItemPool* pPool);

View File

@ -1632,6 +1632,7 @@ EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16
}
EditSelection ImpEditEngine::SelectSentence( const EditSelection& rCurSel )
const
{
uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
const EditPaM& rPaM = rCurSel.Min();

View File

@ -1425,7 +1425,7 @@ Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
}
SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs )
SpellInfo * ImpEditEngine::CreateSpellInfo( bool bMultipleDocs )
{
if (!pSpellInfo)
pSpellInfo = new SpellInfo;
@ -1433,7 +1433,6 @@ SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMul
*pSpellInfo = SpellInfo(); // reset to default values
pSpellInfo->bMultipleDoc = bMultipleDocs;
EditSelection aSentenceSel( SelectSentence( rSel ) );
// always spell draw objects completely, startting at the top.
// (spelling in only a selection or not starting with the top requires
// further changes elsewehe to work properly)
@ -1459,7 +1458,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc )
}
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
pSpellInfo = CreateSpellInfo( aCurSel, bMultipleDoc );
pSpellInfo = CreateSpellInfo( bMultipleDoc );
sal_Bool bIsStart = sal_False;
if ( bMultipleDoc )
@ -1885,8 +1884,7 @@ void ImpEditEngine::StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc)
{
DBG_ASSERT(!pSpellInfo, "pSpellInfo already set?");
rEditView.pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() );
EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
pSpellInfo = CreateSpellInfo( aCurSel, bMultipleDoc );
pSpellInfo = CreateSpellInfo( bMultipleDoc );
}
Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& rSelection)
@ -1942,7 +1940,7 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView,
bool bRet = false;
EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
if(!pSpellInfo)
pSpellInfo = CreateSpellInfo( aCurSel, true );
pSpellInfo = CreateSpellInfo( true );
pSpellInfo->aCurSentenceStart = aCurSel.Min();
DBG_ASSERT( xSpeller.is(), "No spell checker set!" );
pSpellInfo->aLastSpellPortions.clear();

View File

@ -571,10 +571,7 @@ void FlashExporter::exportShape( Reference< XShape >& xShape, bool bMaster )
try
{
com::sun::star::awt::Point aPosition( xShape->getPosition() );
com::sun::star::awt::Size aSize( xShape->getSize() );
com::sun::star::awt::Rectangle aBoundRect;//(aPosition.X, aPosition.Y, aSize.Width, aSize.Height);
com::sun::star::awt::Rectangle aBoundRect;
xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("BoundRect") ) ) >>= aBoundRect;
ShapeInfo* pShapeInfo = new ShapeInfo();

View File

@ -1202,12 +1202,8 @@ bool Writer::Impl_writeStroke( SvtGraphicStroke& rStroke )
rStroke.getPath( aPolygon );
PolyPolygon aPolyPolygon( aPolygon );
Rectangle aOldRect( aPolyPolygon.GetBoundRect() );
map( aPolyPolygon );
Rectangle aNewRect( aPolyPolygon.GetBoundRect() );
// as log as not LINESTYLE2 and DefineShape4 is used (which
// added support for LineJoin), only round LineJoins are
// supported. Fallback to META_POLYLINE_ACTION and META_LINE_ACTION

View File

@ -7395,7 +7395,6 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
SdrObject* pObj( aGroupIter.Next() );
if ( !IsLine( pObj ) )
{
Rectangle aSnapRect( pObj->GetSnapRect() );
sal_Int32 nTableIndex = 0;
sal_Int32 nRow = 0;
sal_Int32 nRowCount = 0;

View File

@ -2740,7 +2740,6 @@ throw( uno::RuntimeException )
return;
// Request to set docking area space again.
awt::Rectangle aDockingArea( m_aDockingArea );
Reference< XDockingAreaAcceptor > xDockingAreaAcceptor( m_xDockingAreaAcceptor );
Reference< awt::XWindow > xContainerWindow( m_xContainerWindow );

View File

@ -59,7 +59,7 @@ void SAL_CALL ManifestWriter::writeManifestSequence( const Reference< XOutputStr
Reference < XDocumentHandler > xHandler ( xSource, UNO_QUERY );
if (xHandler.is())
try {
ManifestExport aExporter ( xHandler, rSequence);
ManifestExport( xHandler, rSequence);
}
catch( SAXException& )
{

View File

@ -935,7 +935,6 @@ void ONavigator::Resize()
{
FloatingWindow::Resize();
Point aPos(GetPosPixel());
Size aSize( GetOutputSizePixel() );
//////////////////////////////////////////////////////////////////////

View File

@ -256,7 +256,6 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground)
}
}
Size aReportWindowSize(aPlaygroundSize);
if ( m_aSplitWin.IsItemValid(TASKPANE_ID) )
{
// normalize the split pos

View File

@ -1329,8 +1329,6 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
{
mpImpl->mpTextEngine->CursorMoved( aOldEnd.GetPara() );
TextSelection aOldSelection( mpImpl->maSelection );
TextSelection aNewSelection( mpImpl->maSelection );
aNewSelection.GetEnd() = aPaM;
if ( bSelect )

View File

@ -1306,20 +1306,16 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
break;
case W_META_ROUNDRECT:
{
Size aSize( ReadYXExt() );
ReadYXExt(); // size
GetWinExtMax( ReadRectangle(), rPlaceableBound, nMapMode );
}
break;
case W_META_ARC:
case W_META_PIE:
case W_META_CHORD:
{
Point aEnd( ReadYX() );
Point aStart( ReadYX() );
ReadYX(); // end
ReadYX(); // start
GetWinExtMax( ReadRectangle(), rPlaceableBound, nMapMode );
}
break;
case W_META_POLYGON:

View File

@ -853,7 +853,6 @@ SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( const SdrObject* pShape2
{
SdrObject* pRet = NULL;
Rectangle aLogicRect( pCustomShape->GetLogicRect() );
PolyPolygon aOutlines2d( GetOutlinesFromShape2d( pShape2d ) );
sal_uInt16 nOutlinesCount2d = aOutlines2d.Count();
if ( nOutlinesCount2d )

View File

@ -378,8 +378,6 @@ void FrameSelectorImpl::InitBorderGeometry()
maArray.SetYOffset( mnLine1 );
maArray.SetAllRowHeights( (mbHor ? mnLine2 : mnLine3) - mnLine1 );
Rectangle aTLRect( maArray.GetCellRect( 0, 0 ) );
// Focus polygons ---------------------------------------------------------
/* Width for focus rectangles from center of frame borders. */

View File

@ -202,10 +202,6 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s
SetFillColor( rFieldColor );
DrawRect( Rectangle( rOrg, aTempSize ) );
// Border Top Bottom Left Right
Point aBegin( rOrg );
Point aEnd( rOrg );
long nL = nLeft;
long nR = nRight;

View File

@ -547,8 +547,6 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double
long dyOutRectHalf = labs(UpperLeft.Y() - LowerRight.Y());
dyOutRectHalf /= 2;
Rectangle RectQuelle(aOutRect), RectZiel(aOutRect);
// Only the center is moved. The corners are moved by NbcMove. For the
// rotation a cartesian coordinate system is used in which the pivot
// point is the origin, and the y-axis increases upward, the X-axis to
@ -571,7 +569,7 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double
// positive direction!
{ // xnew = x * cos(alpha) - y * sin(alpha)
// ynew = x * sin(alpha) + y * cos(alpha)
// Bottom Right is not rotated: the pages of RectQuelle must
// Bottom Right is not rotated: the pages of aOutRect must
// remain parallel to the coordinate axes.
NewCenter.X() = (long) (Center.X() * cs - Center.Y() * sn);
NewCenter.Y() = (long) (Center.X() * sn + Center.Y() * cs);

View File

@ -249,15 +249,15 @@ TYPEINIT1( FmFilterHint, SfxHint );
//========================================================================
class FmFilterInsertedHint : public FmFilterHint
{
sal_Int32 m_nPos; // Position relative to the parent of the data
sal_uLong m_nPos; // Position relative to the parent of the data
public:
TYPEINFO();
FmFilterInsertedHint(FmFilterData* pData, sal_Int32 nRelPos)
FmFilterInsertedHint(FmFilterData* pData, sal_uLong nRelPos)
:FmFilterHint(pData)
,m_nPos(nRelPos){}
sal_Int32 GetPos() const { return m_nPos; }
sal_uLong GetPos() const { return m_nPos; }
};
TYPEINIT1( FmFilterInsertedHint, FmFilterHint );
@ -793,7 +793,7 @@ void FmFilterModel::AppendFilterItems( FmFormItem& _rFormItem )
void FmFilterModel::Insert(const ::std::vector<FmFilterData*>::iterator& rPos, FmFilterData* pData)
{
::std::vector<FmFilterData*>& rItems = pData->GetParent()->GetChildren();
sal_Int32 nPos = rPos == rItems.end() ? LIST_APPEND : rPos - rItems.begin();
sal_uLong nPos = rPos == rItems.end() ? LIST_APPEND : rPos - rItems.begin();
rItems.insert(rPos, pData);
// UI benachrichtigen
@ -1548,7 +1548,7 @@ SvLBoxEntry* FmFilterNavigator::FindEntry(const FmFilterData* pItem) const
}
//------------------------------------------------------------------------
void FmFilterNavigator::Insert(FmFilterData* pItem, sal_Int32 nPos)
void FmFilterNavigator::Insert(FmFilterData* pItem, sal_uLong nPos)
{
const FmParentData* pParent = pItem->GetParent() ? pItem->GetParent() : GetFilterModel();

View File

@ -424,7 +424,6 @@ void FmFieldWin::Resize()
{
SfxFloatingWindow::Resize();
Point aPos(GetPosPixel());
Size aOutputSize( GetOutputSizePixel() );
//////////////////////////////////////////////////////////////////////

View File

@ -162,7 +162,6 @@ void GalleryBrowser::Resize()
const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
const long nFrameWidth2 = nFrameWidth << 1;
Size aMinSize( GetMinOutputSizePixel() );
Size aNewSize( GetOutputSizePixel() );
Point aSplitPos( mpSplitter->GetPosPixel() );
const Size aSplitSize( mpSplitter->GetOutputSizePixel() );

View File

@ -296,7 +296,7 @@ protected:
void DeleteSelection();
SvLBoxEntry* FindEntry(const FmFilterData* pItem) const;
void Insert(FmFilterData* pItem, sal_Int32 nPos);
void Insert(FmFilterData* pItem, sal_uLong nPos);
void Remove(FmFilterData* pItem);
DECL_LINK(OnRemove, SvLBoxEntry*);

View File

@ -956,8 +956,6 @@ void SdrGrafObj::SaveGeoData(SdrObjGeoData& rGeo) const
void SdrGrafObj::RestGeoData(const SdrObjGeoData& rGeo)
{
Size aSizMerk( aRect.GetSize() );
SdrRectObj::RestGeoData(rGeo);
SdrGrafObjGeoData& rGGeo=(SdrGrafObjGeoData&)rGeo;
bMirrored=rGGeo.bMirrored;
@ -1038,8 +1036,6 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier) const
// Sort into group and return ONLY those objects that can be created from the MetaFile.
SdrObjGroup* pGrp = new SdrObjGroup();
ImpSdrGDIMetaFileImport aFilter(*GetModel());
Point aOutPos( aRect.TopLeft() );
const Size aOutSiz( aRect.GetSize() );
aFilter.SetScaleRect(GetSnapRect());
aFilter.SetLayer(GetLayer());

View File

@ -1328,7 +1328,6 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat)
bool bFreeHand=IsFreeHand(pU->eAktKind);
rStat.SetNoSnap(bFreeHand);
rStat.SetOrtho8Possible(pU->eAktKind!=OBJ_CARC && pU->eAktKind!=OBJ_RECT && (!pU->bMixedCreate || pU->eAktKind!=OBJ_LINE));
Point aActMerk(rXPoly[nActPoint]);
rXPoly[nActPoint]=rStat.Now();
if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE && rXPoly.GetPointCount()>=1) {
Point aPt(rStat.Start());
@ -1403,7 +1402,6 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
bool bIncomp=pView!=NULL && pView->IsUseIncompatiblePathCreateInterface();
XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1];
sal_uInt16 nActPoint=rXPoly.GetPointCount()-1;
Point aAktMerk(rXPoly[nActPoint]);
rXPoly[nActPoint]=rStat.Now();
if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE) {
if (rStat.GetPointAnz()>=2) eCmd=SDRCREATE_FORCEEND;