summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-08-26 11:47:12 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-08-26 11:47:12 +0000
commit7cda6b51681f44694bdd53b156c4479628c88bee (patch)
tree87cea67f6c6513d0b110eb2e3b1d6190a0321ecc
parent805b33c4712d953cd33b4cbe62eee8ad04f19ef0 (diff)
CWS-TOOLING: integrate CWS os133
2009-08-17 11:57:21 +0200 od r275041 : #i41413# correction of fix - check, if <Last Name> assignment exist before accessing database 2009-08-13 16:08:34 +0200 tbo r274949 : #i100286# removed from workaround 2009-08-05 10:57:28 +0200 os r274642 : #103994# prevent crash after field undo 2009-08-05 07:58:30 +0200 os r274635 : #103994# prevent crash after field undo 2009-08-04 10:38:40 +0200 os r274611 : #i41413# warnings fixed 2009-08-04 09:34:50 +0200 os r274604 : #103233# unnecessary local variable removed 2009-08-04 09:34:21 +0200 os r274603 : #103233# GetPosition() removed, again 2009-07-27 13:51:58 +0200 os r274362 : CWS-TOOLING: rebase CWS os133 to trunk@274203 (milestone: DEV300:m53) 2009-07-23 12:18:51 +0200 os r274267 : #i41413# salutation preview fixed 2009-07-22 13:55:02 +0200 os r274235 : #i69458# lock expression fields while calculating layout 2009-07-22 10:54:25 +0200 os r274225 : #i103506# page descriptor has to be copied from the working document, not from the source document 2009-07-07 16:01:50 +0200 os r273802 : #i103305# Shift+Ctrl+A should work for single selected drawing objects 2009-07-07 15:36:09 +0200 os r273801 : #ii103137# text:display inversion fixed 2009-07-01 14:19:36 +0200 os r273580 : #103233# access field position directly instead of a text node iteration 2009-06-28 20:05:18 +0200 tbo r273450 : #100285# exchange PDF1/2TBO with HID_FILTER_PDF_INITIAL_VIEW/USER_INTERFACE 2009-06-28 20:04:20 +0200 tbo r273449 : #100285# exchange PDF1/2TBO with HID_FILTER_PDF_INITIAL_VIEW/USER_INTERFACE 2009-06-28 20:03:37 +0200 tbo r273448 : #100285# exchange PDF1/2TBO with HID_FILTER_PDF_INITIAL_VIEW/USER_INTERFACE 2009-06-26 13:58:46 +0200 os r273409 : #i20268# misleading CheckBox name changed and function inverted 2009-06-26 13:33:12 +0200 os r273405 : #i52699# twip convrsion of line width for text documents added 2009-06-26 12:42:47 +0200 os r273399 : #i102967# Gender field name: accept first entry 2009-06-26 12:38:53 +0200 os r273398 : #i103121# caption position in all OLEs can only be below 2009-06-25 14:42:42 +0200 os r273382 : #i99848# member m_xText is not always set 2009-06-25 12:38:30 +0200 os r273377 : #i100285# HelpIds added 2009-06-23 16:01:42 +0200 os r273285 : #i103021# BulletId is a unicode character
-rw-r--r--sw/inc/ndtxt.hxx10
-rw-r--r--sw/inc/rolbck.hxx2
-rw-r--r--sw/inc/txtfld.hxx2
-rw-r--r--sw/inc/unofield.hxx7
-rw-r--r--sw/source/core/doc/docfld.cxx9
-rw-r--r--sw/source/core/txtnode/atrfld.cxx5
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx18
-rw-r--r--sw/source/core/undo/rolbck.cxx2
-rw-r--r--sw/source/core/unocore/unofield.cxx38
-rw-r--r--sw/source/core/unocore/unosett.cxx3
-rw-r--r--sw/source/ui/config/optload.cxx4
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx46
-rw-r--r--sw/source/ui/dbui/mailmergehelper.cxx12
-rw-r--r--sw/source/ui/dbui/makefile.mk1
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx69
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx2
-rw-r--r--sw/source/ui/docvw/edtwin.cxx4
-rw-r--r--sw/source/ui/docvw/postit.cxx60
18 files changed, 149 insertions, 145 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 490062c02f..60d3f86da3 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -774,16 +774,6 @@ public:
// count words in given range
void CountWords( SwDocStat& rStat, xub_StrLen nStart, xub_StrLen nEnd ) const;
- // #111840#
- /**
- Returns position of certain text attribute.
-
- @param pAttr text attribute to search
-
- @return position of given attribute or NULL in case of failure
- */
- SwPosition * GetPosition(const SwTxtAttr * pAttr);
-
// Checks some global conditions like loading or destruction of document
// to economize notifications
bool IsNotificationEnabled() const;
diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx
index 6dd6a90ad6..bd97b81f1b 100644
--- a/sw/inc/rolbck.hxx
+++ b/sw/inc/rolbck.hxx
@@ -160,8 +160,8 @@ public:
class SwHistorySetTxtFld : public SwHistoryHint
{
- const ::std::auto_ptr<SwFmtFld> m_pFld;
::std::auto_ptr<SwFieldType> m_pFldType;
+ const ::std::auto_ptr<SwFmtFld> m_pFld;
ULONG m_nNodeIndex;
xub_StrLen m_nPos;
USHORT m_nFldWhich;
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 130f4eff7c..ec4d399b02 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -64,7 +64,7 @@ public:
@return position of this field. Has to be deleted explicitly.
*/
- SwPosition * GetPosition() const;
+// SwPosition * GetPosition() const;
};
inline SwTxtNode& SwTxtFld::GetTxtNode() const
diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx
index 1a1a489f26..845b9f385a 100644
--- a/sw/inc/unofield.hxx
+++ b/sw/inc/unofield.hxx
@@ -206,13 +206,6 @@ public:
const SwField* GetField() const;
const SwFmtFld* GetFldFmt(){return GetField() ? pFmtFld : 0; };
- // #111840#
- /**
- Returns position of this field.
-
- @return position of this field
- */
- SwPosition * GetPosition();
void Invalidate();
};
/* -----------------21.12.98 10:26-------------------
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 46ba60ffea..05a3efac0e 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -2721,14 +2721,11 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
{
if (DoesUndo())
{
- SwPosition * pPos =
- pDstTxtFld->GetPosition();
+ SwPosition aPosition( pDstTxtFld->GetTxtNode() );
+ aPosition.nContent = *pDstTxtFld->GetStart();
- ASSERT(pPos, "SwTxtFld not in its SwTxtNode?");
-
- AppendUndo(new SwUndoFieldFromDoc(*pPos, *pDstFld, rSrcFld,
+ AppendUndo(new SwUndoFieldFromDoc(aPosition, *pDstFld, rSrcFld,
pMsgHnt, bUpdateFlds));
- delete pPos;
}
// Das gefundene Feld wird angepasst ...
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 2db1dfa22d..7aded130ed 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -386,9 +386,4 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
}
}
-// #111840#
-SwPosition * SwTxtFld::GetPosition() const
-{
- return GetTxtNode().GetPosition(this);
-}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 80e88e673b..ba271beb34 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3581,24 +3581,6 @@ SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
return pOldColl;
}
-// #111840#
-SwPosition * SwTxtNode::GetPosition(const SwTxtAttr * pAttr)
-{
- SwPosition * pResult = NULL;
-
- for (xub_StrLen i = 0; i < Len(); i++)
- {
- if (GetTxtAttr(i, pAttr->Which()) == pAttr)
- {
- pResult = new SwPosition(*this, SwIndex(this, i));
-
- break;
- }
- }
-
- return pResult;
-}
-
SwNodeNum* SwTxtNode::CreateNum() const
{
if ( !mpNodeNum )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index a6b7d3572f..1957c9cea3 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -271,8 +271,8 @@ void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool )
SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, ULONG nNodePos )
: SwHistoryHint( HSTRY_SETTXTFLDHNT )
- , m_pFld( new SwFmtFld( *pTxtFld->GetFld().GetFld() ) )
, m_pFldType( 0 )
+ , m_pFld( new SwFmtFld( *pTxtFld->GetFld().GetFld() ) )
{
// only copy if not Sys-FieldType
SwDoc* pDoc = pTxtFld->GetTxtNode().GetDoc();
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 29ce23c129..778b48294c 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1971,12 +1971,12 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
if (NULL != pDoc)
{
- SwPosition * pPos = GetPosition();
-
- ASSERT(pPos, "no position");
- pDoc->PutValueToField( *pPos, rValue, pEntry->nWID);
-
- delete pPos;
+ const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
+ if(!pTxtFld)
+ throw uno::RuntimeException();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ pDoc->PutValueToField( aPosition, rValue, pEntry->nWID);
}
// <- #111840#
}
@@ -2172,12 +2172,11 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
xub_StrLen nHiddenStart;
xub_StrLen nHiddenEnd;
- SwPosition *pPos = pTxtFld->GetPosition();
- if (!pPos)
- throw uno::RuntimeException();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
- bHidden = SwScriptInfo::GetBoundsOfHiddenRange( rTxtNode,
- pPos->nContent.GetIndex(),
+ bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTxtFld->GetTxtNode(),
+ *pTxtFld->GetStart(),
nHiddenStart, nHiddenEnd );
}
@@ -2477,23 +2476,6 @@ const SwField* SwXTextField::GetField() const
return 0;
}
-// #111840#
-SwPosition * SwXTextField::GetPosition()
-{
- SwPosition * pResult = NULL;
- const SwFmtFld * pFmtFld2 = GetFldFmt();
-
- if (pFmtFld2)
- {
- const SwTxtFld * pTxtFld = pFmtFld2->GetTxtFld();
-
- if (pTxtFld)
- pResult = pTxtFld->GetPosition();
- }
-
- return pResult;
-}
-
/******************************************************************
*
******************************************************************/
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 192e3a1aec..4caa5a735e 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -2041,8 +2041,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
case 15: //"BulletId",
{
sal_Int16 nSet = 0;
- pData->aVal >>= nSet;
- if(nSet < 0xff)
+ if( pData->aVal >>= nSet )
aFmt.SetBulletChar(nSet);
else
bWrongArg = sal_True;
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index e730f09ef5..8943eec2ed 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -782,7 +782,9 @@ IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG )
break;
}
aPosBox.SelectEntryPos(pOpt->GetPos());
- aPosBox.Enable( pOpt->GetObjType() != GRAPHIC_CAP && aPosText.IsEnabled() );
+ aPosBox.Enable( pOpt->GetObjType() != GRAPHIC_CAP &&
+ pOpt->GetObjType() != OLE_CAP &&
+ aPosText.IsEnabled() );
aPosBox.SelectEntryPos(pOpt->GetPos());
USHORT nLevelPos = ( pOpt->GetLevel() < MAXLEVEL ) ? pOpt->GetLevel() + 1 : 0;
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index f2cde72183..5a06a5fb80 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -3248,18 +3248,21 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
- // merge the data
- SwDoc* pWorkDoc = rWorkShell.GetDoc();
- SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
- pWorkDoc->SetNewDBMgr( this );
- pWorkDoc->EmbedAllLinks();
- if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
- rWorkShell.Undo();
- // create a layout
- rWorkShell.CalcLayout();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
- rWorkShell.ViewShell::UpdateFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+ // merge the data
+ SwDoc* pWorkDoc = rWorkShell.GetDoc();
+ SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
+ pWorkDoc->SetNewDBMgr( this );
+ pWorkDoc->EmbedAllLinks();
+ if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
+ rWorkShell.Undo();
+ // #i69485# lock fields to prevent access to the result set while calculating layout
+ rWorkShell.LockExpFlds();
+ // create a layout
+ rWorkShell.CalcLayout();
+ rWorkShell.UnlockExpFlds();
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+ rWorkShell.ViewShell::UpdateFlds();
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
// strip invisible content and convert fields to text
rWorkShell.RemoveInvisibleContent();
@@ -3280,11 +3283,20 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
//create a new pagestyle
//copy the pagedesc from the current document to the new document and change the name of the to-be-applied style
- SwDoc* pTargetDoc = pTargetShell->GetDoc();
- String sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
- pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName );
- SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
- if(pSourcePageDesc && pTargetPageDesc)
+ SwDoc* pTargetDoc = pTargetShell->GetDoc();
+ String sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
+ pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName );
+ SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
+ const SwPageDesc* pWorkPageDesc = rWorkShell.FindPageDescByName( sStartingPageDesc );
+
+ if(pWorkPageDesc && pTargetPageDesc)
+ {
+ pTargetDoc->CopyPageDesc( *pWorkPageDesc, *pTargetPageDesc, sal_False );
+ sModifiedStartingPageDesc = sNewPageDescName;
+ lcl_CopyFollowPageDesc( *pTargetShell, *pWorkPageDesc, *pTargetPageDesc, nDocNo );
+ }
+ }
+ if(nDocNo == 1 || bPageStylesWithHeaderFooter)
{
pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, sal_False );
sModifiedStartingPageDesc = sNewPageDescName;
diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx
index c299133d2e..31d8ad4274 100644
--- a/sw/source/ui/dbui/mailmergehelper.cxx
+++ b/sw/source/ui/dbui/mailmergehelper.cxx
@@ -627,8 +627,16 @@ SwMergeAddressItem SwAddressIterator::Next()
aRet.bIsColumn = true;
xub_StrLen nClose = sAddress.Search('>');
DBG_ASSERT(nClose != STRING_NOTFOUND, "closing '>' not found");
- aRet.sText = sAddress.Copy(1, nClose - 1);
- sAddress.Erase(0, nClose + 1);
+ if( nClose != STRING_NOTFOUND )
+ {
+ aRet.sText = sAddress.Copy(1, nClose - 1);
+ sAddress.Erase(0, nClose + 1);
+ }
+ else
+ {
+ aRet.sText = sAddress.Copy(1, 1);
+ sAddress.Erase(0, 1);
+ }
}
else
{
diff --git a/sw/source/ui/dbui/makefile.mk b/sw/source/ui/dbui/makefile.mk
index b1aa16f694..40d6807c2e 100644
--- a/sw/source/ui/dbui/makefile.mk
+++ b/sw/source/ui/dbui/makefile.mk
@@ -79,6 +79,7 @@ EXCEPTIONSFILES= \
$(SLO)$/mmaddressblockpage.obj \
$(SLO)$/mmconfigitem.obj \
$(SLO)$/mmlayoutpage.obj \
+ $(SLO)$/mmgreetingspage.obj \
$(SLO)$/mmoutputpage.obj
SLOFILES = \
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 874d71820c..03bd610213 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,6 +42,7 @@
#include <vcl/msgbox.hxx>
#include <mmgreetingspage.hrc>
#include <dbui.hrc>
+#include <com/sun/star/sdb/XColumn.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <helpid.h>
@@ -117,6 +118,7 @@ IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG)
m_pWizard->UpdateRoadmap();
m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
}
+ UpdatePreview();
return 0;
}
/*-- 30.04.2004 10:42:57---------------------------------------------------
@@ -133,12 +135,12 @@ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton)
{
ListBox* pToInsert = pButton == m_pMalePB ? m_pMaleLB : m_pFemaleLB;
pToInsert->SelectEntryPos(pToInsert->InsertEntry(pDlg->GetAddress()));
- UpdatePreview();
if(m_bIsTabPage)
{
m_pWizard->UpdateRoadmap();
m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
}
+ UpdatePreview();
}
delete pDlg;
return 0;
@@ -182,9 +184,54 @@ IMPL_LINK(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl, ListBox*, EMPTYARG)
-----------------------------------------------------------------------*/
void SwMailMergeGreetingsPage::UpdatePreview()
{
- String sPreview = m_aFemaleLB.GetSelectEntry();
- sPreview += '\n';
- sPreview += m_aMaleLB.GetSelectEntry();
+ //find out which type of greeting should be selected:
+ bool bFemale = false;
+ bool bNoValue = !m_pFemaleColumnLB->IsEnabled();
+ if( !bNoValue )
+ {
+ ::rtl::OUString sFemaleValue = m_aFemaleFieldCB.GetText();
+ ::rtl::OUString sFemaleColumn = m_aFemaleColumnLB.GetSelectEntry();
+ Reference< sdbcx::XColumnsSupplier > xColsSupp( m_pWizard->GetConfigItem().GetResultSet(), UNO_QUERY);
+ Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0;
+ if(sFemaleValue.getLength() && sFemaleColumn.getLength() &&
+ xColAccess.is() &&
+ xColAccess->hasByName(sFemaleColumn))
+ {
+ //get the content and exchange it in the address string
+ Any aCol = xColAccess->getByName(sFemaleColumn);
+ Reference< sdb::XColumn > xColumn;
+ aCol >>= xColumn;
+ if(xColumn.is())
+ {
+ try
+ {
+ ::rtl::OUString sFemaleColumnValue = xColumn->getString();
+ bFemale = sFemaleColumnValue == sFemaleValue;
+ //bNoValue = !sFemaleColumnValue.getLength();
+ if( !bNoValue )
+ {
+ //no last name value marks the greeting also als neutral
+ SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
+ ::rtl::OUString sLastNameColumn = rConfig.GetAssignedColumn(MM_PART_LASTNAME);
+ if ( xColAccess->hasByName(sLastNameColumn) )
+ {
+ aCol = xColAccess->getByName(sLastNameColumn);
+ aCol >>= xColumn;
+ ::rtl::OUString sLastNameColumnValue = xColumn->getString();
+ bNoValue = !sLastNameColumnValue.getLength();
+ }
+ }
+ }
+ catch( sdbc::SQLException& )
+ {
+ DBG_ERROR("SQLException caught");
+ }
+ }
+ }
+ }
+
+ String sPreview = bFemale ? m_aFemaleLB.GetSelectEntry() :
+ bNoValue ? m_aNeutralCB.GetText() : m_aMaleLB.GetSelectEntry();
sPreview = SwAddressPreview::FillData(sPreview, m_pWizard->GetConfigItem());
m_aPreviewWIN.SetAddress(sPreview);
@@ -284,6 +331,12 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent)
Link aLBoxLink = LINK(this, SwMailMergeGreetingsPage, GreetingSelectHdl_Impl);
m_aFemaleLB.SetSelectHdl(aLBoxLink);
m_aMaleLB.SetSelectHdl(aLBoxLink);
+ m_aFemaleColumnLB.SetSelectHdl(aLBoxLink);
+ m_aFemaleFieldCB.SetSelectHdl(aLBoxLink);
+ m_aFemaleFieldCB.SetModifyHdl(aLBoxLink);
+ m_aNeutralCB.SetSelectHdl(aLBoxLink);
+ m_aNeutralCB.SetModifyHdl(aLBoxLink);
+
Link aDataLink = LINK(this, SwMailMergeGreetingsPage, InsertDataHdl_Impl);
m_aPrevSetIB.SetClickHdl(aDataLink);
m_aNextSetIB.SetClickHdl(aDataLink);
@@ -348,13 +401,9 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( CommitPageReason )
{
const SwDBData& rDBData = rConfig.GetCurrentDBData();
Sequence< ::rtl::OUString> aAssignment = rConfig.GetColumnAssignment( rDBData );
- sal_Int32 nPos = m_aFemaleColumnLB.GetSelectEntryPos();
if(aAssignment.getLength() <= MM_PART_GENDER)
aAssignment.realloc(MM_PART_GENDER + 1);
- if( nPos > 0 )
- aAssignment[MM_PART_GENDER] = m_aFemaleColumnLB.GetSelectEntry();
- else
- aAssignment[MM_PART_GENDER] = ::rtl::OUString();
+ aAssignment[MM_PART_GENDER] = m_aFemaleColumnLB.GetSelectEntry();
rConfig.SetColumnAssignment( rDBData, aAssignment );
}
if(m_aFemaleFieldCB.GetText() != m_aFemaleFieldCB.GetSavedValue())
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 56a8af1fdf..ea475f8bb6 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -614,8 +614,6 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
sCondition += String(rFemaleGenderValue);
sCondition.AppendAscii("\" OR NOT ");
sCondition += String(sNameColumnBase);
- sHideParagraphsExpression += '!';
- sHideParagraphsExpression += sNameColumnBase;
break;
case SwMailMergeConfigItem::NEUTRAL:
sCondition = sNameColumnBase;
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 75486a6215..9911414b54 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1405,8 +1405,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if( rKeyCode.GetFullCode() == (KEY_A | KEY_MOD1 |KEY_SHIFT)
&& rSh.HasDrawView() &&
(0 != (nLclSelectionType = rSh.GetSelectionType()) &&
- ((nLclSelectionType & nsSelectionType::SEL_FRM) ||
- ((nLclSelectionType & nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM) &&
+ ((nLclSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_GRF)) ||
+ ((nLclSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1))))
{
SdrHdlList& rHdlList = (SdrHdlList&)rSh.GetDrawView()->GetHdlList();
diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx
index 3c6b08e79c..5bb42c27ab 100644
--- a/sw/source/ui/docvw/postit.cxx
+++ b/sw/source/ui/docvw/postit.cxx
@@ -1646,19 +1646,17 @@ void SwPostIt::UpdateData()
{
if ( Engine()->IsModified() )
{
- SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition();
- if ( pPos )
- {
- SwField* pOldField = mpFld->Copy();
- mpFld->SetPar2(Engine()->GetEditEngine().GetText());
- mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(*pPos, *pOldField, *mpFld, 0, true));
- delete pOldField;
- delete pPos;
- // so we get a new layout of notes (ankor position is still the same and we would otherwise not get one)
- Mgr()->SetLayout();
- DocView()->GetDocShell()->SetModified();
- }
+ SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ SwField* pOldField = mpFld->Copy();
+ mpFld->SetPar2(Engine()->GetEditEngine().GetText());
+ mpFld->SetTextObject(Engine()->CreateParaObject());
+ DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ delete pOldField;
+ // so we get a new layout of notes (ankor position is still the same and we would otherwise not get one)
+ Mgr()->SetLayout();
+ DocView()->GetDocShell()->SetModified();
}
Engine()->ClearModifyFlag();
Engine()->GetUndoManager().Clear();
@@ -1698,11 +1696,11 @@ sal_uInt32 SwPostIt::MoveCaret()
//returns true, if there is another note right before this note
bool SwPostIt::CalcFollow()
{
- SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition();
- const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- SwTxtAttr* pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex()-1,RES_TXTATR_FIELD ) : 0;
+ SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ SwTxtAttr* pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttr( aPosition.nContent.GetIndex()-1,RES_TXTATR_FIELD );
const SwField* pFld = pTxtAttr ? pTxtAttr->GetFld().GetFld() : 0;
- delete pPos;
return pFld && (pFld->Which()== RES_POSTITFLD);
}
@@ -1710,18 +1708,18 @@ bool SwPostIt::CalcFollow()
sal_uInt32 SwPostIt::CountFollowing()
{
sal_uInt32 aCount = 1; // we start with 1, so we have to subtract one at the end again
- SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition();
- const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
+ SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
- SwTxtAttr* pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex()+1,RES_TXTATR_FIELD ) : 0;
+ SwTxtAttr* pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttr( aPosition.nContent.GetIndex()+1,RES_TXTATR_FIELD );
SwField* pFld = pTxtAttr ? const_cast<SwField*>(pTxtAttr->GetFld().GetFld()) : 0;
while (pFld && (pFld->Which()== RES_POSTITFLD))
{
aCount++;
- pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex() + aCount,RES_TXTATR_FIELD ) : 0;
+ pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttr( aPosition.nContent.GetIndex() + aCount,RES_TXTATR_FIELD );
pFld = pTxtAttr ? const_cast<SwField*>(pTxtAttr->GetFld().GetFld()) : 0;
}
- delete pPos;
return aCount - 1;
}
@@ -1828,16 +1826,14 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText)
// lets insert an undo step so the initial text can be easily deleted
// but do not use UpdateData() directly, would set modified state again and reentrance into Mgr
Engine()->SetModifyHdl( Link() );
- SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition();
- if ( pPos )
- {
- SwField* pOldField = mpFld->Copy();
- mpFld->SetPar2(Engine()->GetEditEngine().GetText());
- mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(*pPos, *pOldField, *mpFld, 0, true));
- delete pOldField;
- delete pPos;
- }
+ SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ SwField* pOldField = mpFld->Copy();
+ mpFld->SetPar2(Engine()->GetEditEngine().GetText());
+ mpFld->SetTextObject(Engine()->CreateParaObject());
+ DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ delete pOldField;
Engine()->SetModifyHdl( LINK( this, SwPostIt, ModifyHdl ) );
Engine()->ClearModifyFlag();
Engine()->GetUndoManager().Clear();