2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:50 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 20:39:13 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-04-04 11:27:19 +00:00
|
|
|
#include <SwPortionHandler.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include "viewopt.hxx" // SwViewOptions
|
|
|
|
|
|
|
|
#include "txtcfg.hxx"
|
|
|
|
#include "portox.hxx"
|
|
|
|
#include "inftxt.hxx" // GetTxtSize()
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwToxPortion::Paint()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwToxPortion::Paint( const SwTxtPaintInfo &rInf ) const
|
|
|
|
{
|
|
|
|
if( Width() )
|
|
|
|
{
|
|
|
|
rInf.DrawViewOpt( *this, POR_TOX );
|
|
|
|
SwTxtPortion::Paint( rInf );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwIsoToxPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
SwLinePortion *SwIsoToxPortion::Compress() { return this; }
|
|
|
|
|
|
|
|
SwIsoToxPortion::SwIsoToxPortion() : nViewWidth(0)
|
|
|
|
{
|
|
|
|
SetLen(1);
|
|
|
|
SetWhichPor( POR_ISOTOX );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwIsoToxPortion::GetViewWidth()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
KSHORT SwIsoToxPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
|
|
|
|
{
|
|
|
|
// Wir stehen zwar im const, aber nViewWidth sollte erst im letzten
|
|
|
|
// Moment errechnet werden:
|
|
|
|
SwIsoToxPortion* pThis = (SwIsoToxPortion*)this;
|
|
|
|
// nViewWidth muss errechnet werden.
|
2002-04-25 13:00:16 +00:00
|
|
|
if( !Width() && rInf.OnWin() &&
|
2002-06-20 08:28:20 +00:00
|
|
|
!rInf.GetOpt().IsPagePreview() &&
|
|
|
|
!rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( !nViewWidth )
|
|
|
|
pThis->nViewWidth = rInf.GetTxtSize( ' ' ).Width();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pThis->nViewWidth = 0;
|
|
|
|
return nViewWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwIsoToxPortion::Format()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
sal_Bool SwIsoToxPortion::Format( SwTxtFormatInfo &rInf )
|
|
|
|
{
|
|
|
|
const sal_Bool bFull = SwLinePortion::Format( rInf );
|
|
|
|
return bFull;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwIsoToxPortion::Paint()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwIsoToxPortion::Paint( const SwTxtPaintInfo &rInf ) const
|
|
|
|
{
|
|
|
|
if( Width() )
|
|
|
|
rInf.DrawViewOpt( *this, POR_TOX );
|
|
|
|
}
|
|
|
|
|
2002-04-04 11:27:19 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* virtual SwIsoToxPortion::HandlePortion()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const
|
|
|
|
{
|
|
|
|
String aString;
|
|
|
|
rPH.Special( GetLen(), aString, GetWhichPor() );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|