summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-09-04 09:21:56 +0000
committerRüdiger Timm <rt@openoffice.org>2008-09-04 09:21:56 +0000
commit83a4961b52a17618dbbe62c2e33cc0473b615071 (patch)
treed48d0bc678643853e023f80eb73ee39590191a15
parentf41a69b7ae9f2b7d7c2dc869fa48c65bad560373 (diff)
INTEGRATION: CWS swenhancedfields2 (1.50.18); FILE MERGED
2008/08/07 11:51:12 b_michaelsen 1.50.18.3: fixed formatting in trvlfrm.cxx portxt.cxx portxt.hxx swfont.cxx unobkm.cxx unocoll.cxx amd unoportenum.cxx 2008/08/04 14:17:37 b_michaelsen 1.50.18.2: RESYNC: (1.50-1.51); FILE MERGED 2008/04/23 14:29:18 ama 1.50.18.1: #i33737#: Enhanced fields
-rw-r--r--sw/source/core/text/portxt.cxx66
1 files changed, 64 insertions, 2 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 0da8c83c17ac..0e62d09744de 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: portxt.cxx,v $
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
* This file is part of OpenOffice.org.
*
@@ -52,6 +52,10 @@
#include <IDocumentSettingAccess.hxx>
#include <viewopt.hxx> // SwViewOptions
+#include <bookmrk.hxx>
+#include <pam.hxx>
+#include <doc.hxx>
+
#if OSL_DEBUG_LEVEL > 1
const sal_Char *GetLangName( const MSHORT nLang );
#endif
@@ -564,7 +568,19 @@ SwPosSize SwTxtPortion::GetTxtSize( const SwTxtSizeInfo &rInf ) const
void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- if( GetLen() )
+ if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetTxt().GetChar(rInf.GetIdx()))
+ {
+ rInf.DrawBackBrush( *this );
+ const XubString aTxt = XubString::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDEND);
+ rInf.DrawText( aTxt, *this, 0, aTxt.Len(), false );
+ }
+ else if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetTxt().GetChar(rInf.GetIdx()))
+ {
+ rInf.DrawBackBrush( *this );
+ const XubString aTxt = XubString::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDSTART);
+ rInf.DrawText( aTxt, *this, 0, aTxt.Len(), false );
+ }
+ else if( GetLen() )
{
rInf.DrawBackBrush( *this );
@@ -750,3 +766,49 @@ void SwHolePortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Text( GetLen(), GetWhichPor() );
}
+void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & ) const
+{
+// SwTxtPortion::Paint(rInf);
+}
+
+sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & )
+{
+ sal_Bool ret=0;
+ Width(0);
+ return ret;
+}
+
+
+void SwFieldFormPortion::Paint( const SwTxtPaintInfo &rInf ) const
+{
+// SwTxtPortion::Paint(rInf);
+ SwTxtNode *pNd=const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode());
+ const SwDoc *doc=pNd->GetDoc();
+ SwIndex aIndex( pNd, rInf.GetIdx() );
+ SwPosition aPosition(*pNd, aIndex);
+ SwFieldBookmark *pBM=doc->getFormFieldBookmarkFor(aPosition);
+ ASSERT(pBM!=NULL, "Where is my form field bookmark???");
+ bool checked=(pBM!=NULL?pBM->IsChecked():false);
+ rInf.DrawCheckBox( *this , checked);
+// const XubString aTxt = XubString::CreateFromAscii("[ ]");
+// rInf.DrawText( aTxt, *this, 0, aTxt.Len(), false );
+}
+
+sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo &rInf )
+{
+ sal_Bool ret=0;
+// ret=SwTxtPortion::Format(rInf);
+
+ Width(rInf.GetTxtHeight());
+ Height(rInf.GetTxtHeight());
+ SetAscent(rInf.GetAscent());
+ //int h=rInf.GetTxtHeight();
+
+/*
+ Height(100);
+ SetAscent(100);
+*/
+ return ret;
+}
+
+