summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx10
-rw-r--r--sw/source/ui/dbui/addresslistdialog.src5
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx18
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.src13
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.cxx16
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.src7
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx210
-rw-r--r--sw/source/ui/dbui/dbinsdlg.src21
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx347
-rw-r--r--sw/source/ui/dbui/dbtree.cxx34
-rw-r--r--sw/source/ui/dbui/dbui.src1
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx6
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.src1
-rw-r--r--sw/source/ui/dbui/mailmergehelper.cxx8
-rw-r--r--sw/source/ui/dbui/mailmergewizard.src1
-rw-r--r--sw/source/ui/dbui/makefile.mk108
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx87
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.src23
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx12
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.src8
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx20
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.src6
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx20
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.src6
-rw-r--r--sw/source/ui/dbui/mmmergepage.src6
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx63
-rw-r--r--sw/source/ui/dbui/mmoutputpage.src27
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.src2
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.src7
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx4
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.src1
-rw-r--r--sw/source/ui/dbui/swdbtoolsclient.cxx4
34 files changed, 606 insertions, 500 deletions
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 6b3c1a494f..2fec46bf76 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -211,7 +211,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
m_aListLB.SetHelpId(HID_MM_ADDRESSLIST_TLB);
static long nTabs[] = {2, 0, aSz.Width()/2 };
- m_aListLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
+ m_aListLB.SetStyle( m_aListLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aListLB.SetSelectionMode( SINGLE_SELECTION );
m_aListLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aOK.SetClickHdl( LINK( this, SwAddressListDialog, OKHdl_Impl));
@@ -228,7 +228,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
OSL_ENSURE(m_xDBContext.is(), "service 'com.sun.star.sdb.DatabaseContext' not found!");
sal_Bool bEnableEdit = sal_False;
sal_Bool bEnableOK = sal_True;
- m_aListLB.SelectAll( FALSE );
+ m_aListLB.SelectAll( sal_False );
if(m_xDBContext.is())
{
@@ -445,7 +445,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
pUserData->sURL = sURL;
m_pCreatedDataSource->SetUserData(pUserData);
m_aListLB.Select(m_pCreatedDataSource);
- m_aCreateListPB.Enable(FALSE);
+ m_aCreateListPB.Enable(sal_False);
}
catch(Exception& )
@@ -512,7 +512,7 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*,
pThis->m_aListLB.SetEntryText(pThis->m_sConnecting, pSelect, ITEMID_TABLE - 1);
// allow painting of the new entry
pThis->m_aListLB.Window::Invalidate(INVALIDATE_UPDATE);
- for (USHORT i = 0; i < 10; i++)
+ for (sal_uInt16 i = 0; i < 10; i++)
Application::Reschedule();
}
@@ -674,7 +674,7 @@ IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton)
IMPL_LINK(SwAddressListDialog, OKHdl_Impl, PushButton*, EMPTYARG)
{
- EndDialog(TRUE);
+ EndDialog(sal_True);
return 0;
}
diff --git a/sw/source/ui/dbui/addresslistdialog.src b/sw/source/ui/dbui/addresslistdialog.src
index 64fcaf7806..a9f933ecda 100644
--- a/sw/source/ui/dbui/addresslistdialog.src
+++ b/sw/source/ui/dbui/addresslistdialog.src
@@ -61,30 +61,35 @@ ModalDialog DLG_MM_ADDRESSLISTDIALOG
};
PushButton PB_LOADLIST
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_LOADLIST";
Pos = MAP_APPFONT ( 194 , 43 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Add...";
};
PushButton PB_CREATELIST
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_CREATELIST";
Pos = MAP_APPFONT ( 194 , 60 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Create...";
};
PushButton PB_FILTER
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_FILTER";
Pos = MAP_APPFONT ( 194 , 77 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Filter...";
};
PushButton PB_EDIT
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_EDIT";
Pos = MAP_APPFONT ( 194 , 94 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Edit...";
};
PushButton PB_TABLE
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSLISTDIALOG:PB_TABLE";
Pos = MAP_APPFONT ( 194 , 111 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "Change ~Table...";
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 6364d5d065..85b5151649 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -212,11 +212,11 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
if(nContentHeight < m_aScrollBar.GetSizePixel().Height())
{
nContentHeight = m_aScrollBar.GetSizePixel().Height();
- m_aScrollBar.Enable(FALSE);
+ m_aScrollBar.Enable(sal_False);
}
else
{
- m_aScrollBar.Enable(TRUE);
+ m_aScrollBar.Enable(sal_True);
m_aScrollBar.SetRange(Range(0, nLines));
m_aScrollBar.SetThumbPos(0);
m_aScrollBar.SetVisibleSize(nVisibleLines);
@@ -339,7 +339,7 @@ long SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt )
if(rNEvt.GetType() == EVENT_COMMAND)
{
const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
- USHORT nCmd = pCEvt->GetCommand();
+ sal_uInt16 nCmd = pCEvt->GetCommand();
if( COMMAND_WHEEL == nCmd )
{
Command(*pCEvt);
@@ -399,7 +399,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
if(m_sURL.Len())
{
//file exists, has to be loaded here
- SfxMedium aMedium( m_sURL, STREAM_READ, TRUE );
+ SfxMedium aMedium( m_sURL, STREAM_READ, sal_True );
SvStream* pStream = aMedium.GetInStream();
if(pStream)
{
@@ -413,7 +413,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
OUString sMiddle(sTempMiddle);
String sLine;
- BOOL bRead = pStream->ReadUniOrByteStringLine( sLine, RTL_TEXTENCODING_UTF8 );
+ sal_Bool bRead = pStream->ReadUniOrByteStringLine( sLine, RTL_TEXTENCODING_UTF8 );
if(bRead)
{
@@ -458,7 +458,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog(
//database has to be created
const ResStringArray& rAddressHeader = rConfig.GetDefaultAddressHeaders();
sal_uInt32 nCount = rAddressHeader.Count();
- for(USHORT nHeader = 0; nHeader < nCount; ++nHeader)
+ for(sal_uInt16 nHeader = 0; nHeader < nCount; ++nHeader)
m_pCSVData->aDBColumnHeaders.push_back( rAddressHeader.GetString(nHeader));
::std::vector<OUString> aNewData;
String sTemp;
@@ -509,7 +509,7 @@ IMPL_LINK(SwCreateAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
// if only one set is available then clear the data
String sTemp;
m_pCSVData->aDBData[0].assign(m_pCSVData->aDBData[0].size(), sTemp);
- m_aDeletePB.Enable(FALSE);
+ m_aDeletePB.Enable(sal_False);
}
m_pAddressControl->SetCurrentDataSet(nCurrent);
m_aSetNoNF.SetMax(m_pCSVData->aDBData.size());
@@ -586,7 +586,7 @@ IMPL_LINK(SwCreateAddressListDialog, OkHdl_Impl, PushButton*, EMPTYARG)
}
if(m_sURL.Len())
{
- SfxMedium aMedium( m_sURL, STREAM_READWRITE|STREAM_TRUNC, TRUE );
+ SfxMedium aMedium( m_sURL, STREAM_READWRITE|STREAM_TRUNC, sal_True );
SvStream* pStream = aMedium.GetOutStream();
pStream->SetLineDelimiter( LINEEND_LF );
pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
@@ -769,7 +769,7 @@ IMPL_LINK(SwFindEntryDialog, FindEnableHdl_Impl, Edit*, EMPTYARG)
IMPL_LINK(SwFindEntryDialog, CloseHdl_Impl, PushButton*, EMPTYARG)
{
- Show(FALSE);
+ Show(sal_False);
return 0;
}
diff --git a/sw/source/ui/dbui/createaddresslistdialog.src b/sw/source/ui/dbui/createaddresslistdialog.src
index d2e4e5f84e..1679aa18f2 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.src
+++ b/sw/source/ui/dbui/createaddresslistdialog.src
@@ -67,24 +67,28 @@ ModalDialog DLG_MM_CREATEADDRESSLIST
};
PushButton PB_NEW
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_NEW";
Pos = MAP_APPFONT ( 262 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~New";
};
PushButton PB_DELETE
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_DELETE";
Pos = MAP_APPFONT ( 262 , 32 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete";
};
PushButton PB_FIND
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_FIND";
Pos = MAP_APPFONT ( 262 , 50 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Find...";
};
PushButton PB_CUSTOMIZE
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_CUSTOMIZE";
Pos = MAP_APPFONT ( 262 , 68 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "C~ustomize...";
@@ -97,18 +101,21 @@ ModalDialog DLG_MM_CREATEADDRESSLIST
};
PushButton PB_START
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_START";
Pos = MAP_APPFONT ( 100 , 180 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = "|<";
};
PushButton PB_PREV
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_PREV";
Pos = MAP_APPFONT ( 123 , 180 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = "<";
};
NumericField NF_SETNO
{
+ HelpID = "sw:NumericField:DLG_MM_CREATEADDRESSLIST:NF_SETNO";
Pos = MAP_APPFONT ( 146 , 180 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Border = TRUE;
@@ -122,12 +129,14 @@ ModalDialog DLG_MM_CREATEADDRESSLIST
};
PushButton PB_NEXT
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_NEXT";
Pos = MAP_APPFONT ( 169 , 180 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = ">";
};
PushButton PB_END
{
+ HelpID = "sw:PushButton:DLG_MM_CREATEADDRESSLIST:PB_END";
Pos = MAP_APPFONT ( 192 , 180 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = ">|";
@@ -179,18 +188,21 @@ ModelessDialog DLG_MM_FIND_ENTRY
};
Edit ED_FIND
{
+ HelpID = "sw:Edit:DLG_MM_FIND_ENTRY:ED_FIND";
Pos = MAP_APPFONT ( 6 , 14) ;
Size = MAP_APPFONT ( 120 , 12 ) ;
Border = TRUE;
};
CheckBox CB_FINDONLY
{
+ HelpID = "sw:CheckBox:DLG_MM_FIND_ENTRY:CB_FINDONLY";
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 120 , 10 ) ;
Text [ en-US ] = "Find ~only in";
};
ListBox LB_FINDONLY
{
+ HelpID = "sw:ListBox:DLG_MM_FIND_ENTRY:LB_FINDONLY";
Pos = MAP_APPFONT ( 12 , 45 ) ;
Size = MAP_APPFONT ( 114 , 50 ) ;
Border = TRUE;
@@ -198,6 +210,7 @@ ModelessDialog DLG_MM_FIND_ENTRY
};
PushButton PB_FIND
{
+ HelpID = "sw:PushButton:DLG_MM_FIND_ENTRY:PB_FIND";
Pos = MAP_APPFONT ( 132 , 3 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE;
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
index 6d8f3b06a8..46dd609f3e 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
@@ -96,7 +96,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl, ListBox*, EMPTYAR
IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
{
bool bRename = pButton == &m_aRenamePB;
- USHORT nPos = m_aFieldsLB.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos();
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
@@ -139,7 +139,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
{
- USHORT nPos = m_aFieldsLB.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos();
m_aFieldsLB.RemoveEntry(m_aFieldsLB.GetSelectEntryPos());
m_aFieldsLB.SelectEntryPos(nPos > m_aFieldsLB.GetEntryCount() - 1 ? nPos - 1 : nPos);
@@ -156,8 +156,8 @@ IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG)
IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton)
{
- USHORT nPos;
- USHORT nOldPos = nPos = m_aFieldsLB.GetSelectEntryPos();
+ sal_uInt16 nPos;
+ sal_uInt16 nOldPos = nPos = m_aFieldsLB.GetSelectEntryPos();
String aTemp = m_aFieldsLB.GetEntry(nPos);
m_aFieldsLB.RemoveEntry( nPos );
if(pButton == &m_aUpPB)
@@ -184,8 +184,8 @@ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton)
void SwCustomizeAddressListDialog::UpdateButtons()
{
- USHORT nPos = m_aFieldsLB.GetSelectEntryPos();
- USHORT nEntries = m_aFieldsLB.GetEntryCount();
+ sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos();
+ sal_uInt16 nEntries = m_aFieldsLB.GetEntryCount();
m_aUpPB.Enable(nPos > 0 && nEntries > 0);
m_aDownPB.Enable(nPos < nEntries -1);
m_aDeletePB.Enable(nEntries > 0);
@@ -229,7 +229,7 @@ SwAddRenameEntryDialog::~SwAddRenameEntryDialog()
IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit)
{
::rtl::OUString sEntry = pEdit->GetText();
- BOOL bFound = sEntry.getLength() ? FALSE : TRUE;
+ sal_Bool bFound = sEntry.getLength() ? sal_False : sal_True;
if(!bFound)
{
@@ -239,7 +239,7 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit)
++aHeaderIter)
if(*aHeaderIter == sEntry)
{
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.src b/sw/source/ui/dbui/customizeaddresslistdialog.src
index 38afd0bfe1..d95be1128a 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.src
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.src
@@ -47,30 +47,35 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST
};
ListBox LB_FIELDS
{
+ HelpID = "sw:ListBox:DLG_MM_CUSTOMIZE_ADDRESS_LIST:LB_FIELDS";
Pos = MAP_APPFONT ( 6 , 14 ) ;
Size = MAP_APPFONT ( 112 , 120 ) ;
Border = TRUE;
};
PushButton PB_ADD
{
+ HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_ADD";
Pos = MAP_APPFONT ( 144 , 3 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Add...";
};
PushButton PB_DELETE
{
+ HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_DELETE";
Pos = MAP_APPFONT ( 144 , 20 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Delete";
};
PushButton PB_RENAME
{
+ HelpID = "sw:PushButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_RENAME";
Pos = MAP_APPFONT ( 144 , 37 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Rename...";
};
ImageButton PB_UP
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_UP";
Pos = MAP_APPFONT ( 124 , 58 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
SYMBOL = IMAGEBUTTON_ARROW_UP;
@@ -78,6 +83,7 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST
};
ImageButton PB_DOWN
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZE_ADDRESS_LIST:PB_DOWN";
Pos = MAP_APPFONT ( 124 , 75 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
SYMBOL = IMAGEBUTTON_ARROW_DOWN;
@@ -124,6 +130,7 @@ ModalDialog DLG_MM_ADD_RENAME_ENTRY
};
Edit ED_FIELDNAME
{
+ HelpID = "sw:Edit:DLG_MM_ADD_RENAME_ENTRY:ED_FIELDNAME";
Pos = MAP_APPFONT ( 6 , 14 ) ;
Size = MAP_APPFONT ( 120 , 12 ) ;
Border = TRUE;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index d4ef2891cd..ffa822ec7f 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -136,7 +136,7 @@ struct _DB_Column
union {
String* pText;
SwField* pField;
- ULONG nFormat;
+ sal_uLong nFormat;
} DB_ColumnData;
const SwInsDBColumn* pColInfo;
@@ -154,7 +154,7 @@ struct _DB_Column
eColType = DB_FILLTEXT;
}
- _DB_Column( const SwInsDBColumn& rInfo, ULONG nFormat )
+ _DB_Column( const SwInsDBColumn& rInfo, sal_uLong nFormat )
{
pColInfo = &rInfo;
DB_ColumnData.nFormat = nFormat;
@@ -193,15 +193,15 @@ struct _DB_ColumnConfigData
{
SwInsDBColumns aDBColumns;
rtl::OUString sSource, sTable, sEdit, sTblList, sTmplNm, sTAutoFmtNm;
- BOOL bIsTable : 1,
+ sal_Bool bIsTable : 1,
bIsField : 1,
bIsHeadlineOn : 1,
bIsEmptyHeadln : 1;
_DB_ColumnConfigData()
{
- bIsTable = bIsHeadlineOn = TRUE;
- bIsField = bIsEmptyHeadln = FALSE;
+ bIsTable = bIsHeadlineOn = sal_True;
+ bIsField = bIsEmptyHeadln = sal_False;
}
~_DB_ColumnConfigData();
@@ -304,7 +304,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
long nCount = aColNames.getLength();
for (long n = 0; n < nCount; n++)
{
- SwInsDBColumn* pNew = new SwInsDBColumn( pColNames[n], (USHORT)n );
+ SwInsDBColumn* pNew = new SwInsDBColumn( pColNames[n], (sal_uInt16)n );
Any aCol = xCols->getByName(pColNames[n]);
Reference <XPropertySet> xCol;
aCol >>= xCol;
@@ -328,7 +328,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
case DataType::TIME:
case DataType::TIMESTAMP:
{
- pNew->bHasFmt = TRUE;
+ pNew->bHasFmt = sal_True;
Any aFormat = xCol->getPropertyValue(C2U("FormatKey"));
if(aFormat.hasValue())
{
@@ -393,16 +393,16 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
// when the cursor is inside of a table, table must NEVER be selectable
if( pView->GetWrtShell().GetTableFmt() )
{
- aRbAsTable.Enable( FALSE );
- aRbAsField.Check( TRUE );
- aRbDbFmtFromDb.Check( TRUE );
+ aRbAsTable.Enable( sal_False );
+ aRbAsField.Check( sal_True );
+ aRbDbFmtFromDb.Check( sal_True );
}
else
{
- aRbAsTable.Check( TRUE );
- aRbDbFmtFromDb.Check( TRUE );
- aIbDbcolOneFrom.Enable( FALSE );
- aIbDbcolAllFrom.Enable( FALSE );
+ aRbAsTable.Check( sal_True );
+ aRbDbFmtFromDb.Check( sal_True );
+ aIbDbcolOneFrom.Enable( sal_False );
+ aIbDbcolAllFrom.Enable( sal_False );
}
aRbAsTable.SetClickHdl( LINK(this, SwInsertDBColAutoPilot, PageHdl ));
@@ -434,7 +434,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
aLbTblDbColumn.SetDoubleClickHdl( LINK( this, SwInsertDBColAutoPilot, DblClickHdl ));
aLbTableCol.SetDoubleClickHdl( LINK( this, SwInsertDBColAutoPilot, DblClickHdl ));
- for( USHORT n = 0; n < aDBColumns.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aDBColumns.Count(); ++n )
{
const String& rS = aDBColumns[ n ]->sColumn;
aLbTblDbColumn.InsertEntry( rS, n );
@@ -460,7 +460,7 @@ SwInsertDBColAutoPilot::~SwInsertDBColAutoPilot()
IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton )
{
- BOOL bShowTbl = pButton == &aRbAsTable;
+ sal_Bool bShowTbl = pButton == &aRbAsTable;
String sTxt( pButton->GetText() );
aFlHead.SetText( MnemonicGenerator::EraseAllMnemonicChars( sTxt ) );
@@ -494,7 +494,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton )
IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton )
{
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
ListBox& rBox = aRbAsTable.IsChecked()
? ( 0 == aLbTableCol.GetEntryData( 0 )
? aLbTblDbColumn
@@ -504,7 +504,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton )
SwInsDBColumn aSrch( rBox.GetSelectEntry(), 0 );
aDBColumns.Seek_Entry( &aSrch, &nFndPos );
- BOOL bFromDB = &aRbDbFmtFromDb == pButton;
+ sal_Bool bFromDB = &aRbDbFmtFromDb == pButton;
aDBColumns[ nFndPos ]->bIsDBFmt = bFromDB;
aLbDbFmtFromUsr.Enable( !bFromDB );
@@ -513,15 +513,15 @@ IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton )
IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
{
- BOOL bChgEnable = TRUE, bEnableTo = TRUE, bEnableFrom = TRUE;
- aLbTblDbColumn.SetUpdateMode( FALSE );
- aLbTableCol.SetUpdateMode( FALSE );
+ sal_Bool bChgEnable = sal_True, bEnableTo = sal_True, bEnableFrom = sal_True;
+ aLbTblDbColumn.SetUpdateMode( sal_False );
+ aLbTableCol.SetUpdateMode( sal_False );
if( pButton == &aIbDbcolAllTo )
{
- bEnableTo = FALSE;
+ bEnableTo = sal_False;
- USHORT n, nInsPos = aLbTableCol.GetSelectEntryPos(),
+ sal_uInt16 n, nInsPos = aLbTableCol.GetSelectEntryPos(),
nCnt = aLbTblDbColumn.GetEntryCount();
if( LISTBOX_APPEND == nInsPos )
for( n = 0; n < nCnt; ++n )
@@ -537,7 +537,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
else if( pButton == &aIbDbcolOneTo &&
LISTBOX_ENTRY_NOTFOUND != aLbTblDbColumn.GetSelectEntryPos() )
{
- USHORT nInsPos = aLbTableCol.GetSelectEntryPos(),
+ sal_uInt16 nInsPos = aLbTableCol.GetSelectEntryPos(),
nDelPos = aLbTblDbColumn.GetSelectEntryPos(),
nTopPos = aLbTblDbColumn.GetTopEntry();
aLbTableCol.InsertEntry( aLbTblDbColumn.GetEntry( nDelPos ), nInsPos );
@@ -555,7 +555,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
{
if( LISTBOX_ENTRY_NOTFOUND != aLbTableCol.GetSelectEntryPos() )
{
- USHORT nFndPos, nInsPos,
+ sal_uInt16 nFndPos, nInsPos,
nDelPos = aLbTableCol.GetSelectEntryPos(),
nTopPos = aLbTableCol.GetTopEntry();
@@ -592,24 +592,24 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
}
else if( pButton == &aIbDbcolAllFrom )
{
- bEnableFrom = FALSE;
+ bEnableFrom = sal_False;
aLbTblDbColumn.Clear();
aLbTableCol.Clear();
- for( USHORT n = 0; n < aDBColumns.Count(); ++n )
+ for( sal_uInt16 n = 0; n < aDBColumns.Count(); ++n )
aLbTblDbColumn.InsertEntry( aDBColumns[ n ]->sColumn, n );
aLbTblDbColumn.SelectEntryPos( 0 );
}
else if( pButton == &aIbDbcolToEdit )
{
- bChgEnable = FALSE;
+ bChgEnable = sal_False;
// move data to Edit:
String aFld( aLbTxtDbColumn.GetSelectEntry() );
if( aFld.Len() )
{
String aStr( aEdDbText.GetText() );
- USHORT nPos = (USHORT)aEdDbText.GetSelection().Min();
- USHORT nSel = USHORT(aEdDbText.GetSelection().Max()) - nPos;
+ sal_uInt16 nPos = (sal_uInt16)aEdDbText.GetSelection().Min();
+ sal_uInt16 nSel = sal_uInt16(aEdDbText.GetSelection().Max()) - nPos;
if( nSel )
// first delete the existing selection
aStr.Erase( nPos, nSel );
@@ -646,14 +646,14 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton )
aIbDbcolOneFrom.Enable( bEnableFrom );
aIbDbcolAllFrom.Enable( bEnableFrom );
- aRbDbFmtFromDb.Enable( FALSE );
- aRbDbFmtFromUsr.Enable( FALSE );
- aLbDbFmtFromUsr.Enable( FALSE );
+ aRbDbFmtFromDb.Enable( sal_False );
+ aRbDbFmtFromUsr.Enable( sal_False );
+ aLbDbFmtFromUsr.Enable( sal_False );
aPbTblFormat.Enable( bEnableFrom );
}
- aLbTblDbColumn.SetUpdateMode( TRUE );
- aLbTableCol.SetUpdateMode( TRUE );
+ aLbTblDbColumn.SetUpdateMode( sal_True );
+ aLbTableCol.SetUpdateMode( sal_True );
return 0;
}
@@ -677,10 +677,10 @@ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox*, pBox )
IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
{
SwWrtShell& rSh = pView->GetWrtShell();
- BOOL bNewSet = FALSE;
+ sal_Bool bNewSet = sal_False;
if( !pTblSet )
{
- bNewSet = TRUE;
+ bNewSet = sal_True;
pTblSet = new SfxItemSet( rSh.GetAttrPool(), SwuiGetUITableAttrRange() );
// At first acquire the simple attributes
@@ -697,19 +697,19 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
// table variant, when multiple table cells are selected
- aBoxInfo.SetTable( TRUE );
+ aBoxInfo.SetTable( sal_True );
// always show gap field
- aBoxInfo.SetDist( TRUE);
+ aBoxInfo.SetDist( sal_True);
// set minimum size in tables and paragraphs
- aBoxInfo.SetMinDist( FALSE );
+ aBoxInfo.SetMinDist( sal_False );
// always set default-gap
aBoxInfo.SetDefDist( MIN_BORDER_DIST );
// Single lines can have DontCare-status only in tables
- aBoxInfo.SetValid( VALID_DISABLE, TRUE );
+ aBoxInfo.SetValid( VALID_DISABLE, sal_True );
pTblSet->Put( aBoxInfo );
SwGetCurColNumPara aPara;
- const USHORT nNum = rSh.GetCurColNum( &aPara );
+ const sal_uInt16 nNum = rSh.GetCurColNum( &aPara );
long nWidth;
if( nNum )
@@ -722,11 +722,11 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
long nWidth1 = 0,
nStart1 = 0,
nEnd1 = nWidth;
- for( USHORT i = 0; i < nNum; ++i )
+ for( sal_uInt16 i = 0; i < nNum; ++i )
{
SwColumn* pCol = rCols[i];
nStart1 = pCol->GetLeft() + nWidth1;
- nWidth1 += (long)rCol.CalcColWidth( i, (USHORT)nWidth );
+ nWidth1 += (long)rCol.CalcColWidth( i, (sal_uInt16)nWidth );
nEnd1 = nWidth1 - pCol->GetRight();
}
if(nStart1 || nEnd1 != nWidth)
@@ -734,14 +734,14 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
}
else
nWidth = rSh.GetAnyCurRect(
- FRMTYPE_FLY_ANY & rSh.GetFrmType( 0, TRUE )
+ FRMTYPE_FLY_ANY & rSh.GetFrmType( 0, sal_True )
? RECT_FLY_PRT_EMBEDDED
: RECT_PAGE_PRT ).Width();
SwTabCols aTabCols;
aTabCols.SetRight( nWidth );
aTabCols.SetRightMax( nWidth );
- pRep = new SwTableRep( aTabCols, FALSE );
+ pRep = new SwTableRep( aTabCols, sal_False );
pRep->SetAlign( text::HoriOrientation::NONE );
pRep->SetSpace( nWidth );
pRep->SetWidth( nWidth );
@@ -756,18 +756,18 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton )
{
// Number of columns has changed: then the TabCols have to be adjusted
long nWidth = pRep->GetWidth();
- USHORT nCols = aLbTableCol.GetEntryCount() - 1;
+ sal_uInt16 nCols = aLbTableCol.GetEntryCount() - 1;
SwTabCols aTabCols( nCols );
aTabCols.SetRight( nWidth );
aTabCols.SetRightMax( nWidth );
if( nCols )
- for( USHORT n = 0, nStep = (USHORT)(nWidth / (nCols+1)), nW = nStep;
+ for( sal_uInt16 n = 0, nStep = (sal_uInt16)(nWidth / (nCols+1)), nW = nStep;
n < nCols; ++n, nW = nW + nStep )
{
- aTabCols.Insert( nW, FALSE, n );
+ aTabCols.Insert( nW, sal_False, n );
}
delete pRep;
- pRep = new SwTableRep( aTabCols, FALSE );
+ pRep = new SwTableRep( aTabCols, sal_False );
pRep->SetAlign( text::HoriOrientation::NONE );
pRep->SetSpace( nWidth );
pRep->SetWidth( nWidth );
@@ -797,7 +797,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, AutoFmtHdl, PushButton*, pButton )
SwAbstractDialogFactory* pFact = swui::GetFactory();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(),DLG_AUTOFMT_TABLE, FALSE, pTAutoFmt);
+ AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(),DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute())
pDlg->FillAutoFmtOfIndex( pTAutoFmt );
@@ -815,7 +815,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
: &aLbTxtDbColumn )
: pBox;
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
SwInsDBColumn aSrch( pGetBox->GetSelectEntry(), 0 );
aDBColumns.Seek_Entry( &aSrch, &nFndPos );
@@ -834,13 +834,13 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
String sTxt( aFlFormat.GetText().Copy( 0, nGBFmtLen ));
if( !aSrch.sColumn.getLength() )
{
- aRbDbFmtFromDb.Enable( FALSE );
- aRbDbFmtFromUsr.Enable( FALSE );
- aLbDbFmtFromUsr.Enable( FALSE );
+ aRbDbFmtFromDb.Enable( sal_False );
+ aRbDbFmtFromUsr.Enable( sal_False );
+ aLbDbFmtFromUsr.Enable( sal_False );
}
else
{
- BOOL bEnableFmt = aDBColumns[ nFndPos ]->bHasFmt;
+ sal_Bool bEnableFmt = aDBColumns[ nFndPos ]->bHasFmt;
aRbDbFmtFromDb.Enable( bEnableFmt );
aRbDbFmtFromUsr.Enable( bEnableFmt );
@@ -849,7 +849,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox )
(( sTxt += C2S(" (" )) += String(aSrch.sColumn) ) += (sal_Unicode)')';
}
- BOOL bIsDBFmt = aDBColumns[ nFndPos ]->bIsDBFmt;
+ sal_Bool bIsDBFmt = aDBColumns[ nFndPos ]->bIsDBFmt;
aRbDbFmtFromDb.Check( bIsDBFmt );
aRbDbFmtFromUsr.Check( !bIsDBFmt );
aLbDbFmtFromUsr.Enable( !bIsDBFmt );
@@ -871,7 +871,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton )
{
if( pButton == &aCbTableHeadon )
{
- BOOL bEnable = aCbTableHeadon.IsChecked();
+ sal_Bool bEnable = aCbTableHeadon.IsChecked();
aRbHeadlColnms.Enable( bEnable );
aRbHeadlEmpty.Enable( bEnable );
@@ -882,7 +882,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton )
static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr )
{
_DB_Column* pNew;
- USHORT nSttPos = 0, nFndPos;
+ sal_uInt16 nSttPos = 0, nFndPos;
while( STRING_NOTFOUND != ( nFndPos = rTxt.Search( '\x0A', nSttPos )) )
{
if( 1 < nFndPos )
@@ -901,15 +901,15 @@ static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr )
}
}
-BOOL SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
+sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
_DB_Columns& rColArr,
- BOOL bInsField )
+ sal_Bool bInsField )
{
// create each of the database columns from the text again
// and then save in an array
// database columns are in <> and must be present in the columns' array:
String sTxt( rTxt );
- USHORT nFndPos, nEndPos, nSttPos = 0;
+ sal_uInt16 nFndPos, nEndPos, nSttPos = 0;
while( STRING_NOTFOUND != ( nFndPos = sTxt.Search( cDBFldStart, nSttPos )))
{
@@ -935,8 +935,8 @@ BOOL SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt,
sTxt.Erase( 0, (xub_StrLen)(rFndCol.sColumn.getLength() + 2) );
nSttPos = 0;
- USHORT nSubType = 0;
- ULONG nFormat;
+ sal_uInt16 nSubType = 0;
+ sal_uLong nFormat;
if( rFndCol.bHasFmt )
{
if( rFndCol.bIsDBFmt )
@@ -985,7 +985,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
SwWrtShell& rSh = pView->GetWrtShell();
//with the drag and drop interface no result set is initially available
- BOOL bDisposeResultSet = FALSE;
+ sal_Bool bDisposeResultSet = sal_False;
// we don't have a cursor, so we have to create our own RowSet
if ( !xResultSet.is() )
{
@@ -998,11 +998,11 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
return;
rSh.StartAllAction();
- BOOL bUndo = rSh.DoesUndo();
+ sal_Bool bUndo = rSh.DoesUndo();
if( bUndo )
rSh.StartUndo( UNDO_EMPTY );
- BOOL bAsTable = aRbAsTable.IsChecked();
+ sal_Bool bAsTable = aRbAsTable.IsChecked();
SvNumberFormatter& rNumFmtr = *rSh.GetNumberFormatter();
if( rSh.HasSelection() )
@@ -1016,22 +1016,22 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
do{ // middle checked loop!!
if( bAsTable ) // Daten als Tabelle einfuegen
{
- rSh.DoUndo( FALSE );
+ rSh.DoUndo( sal_False );
- USHORT n, nRows = 0, nCols = aLbTableCol.GetEntryCount();
+ sal_uInt16 n, nRows = 0, nCols = aLbTableCol.GetEntryCount();
if( aCbTableHeadon.IsChecked() )
nRows++;
if( pSelection )
- nRows = nRows + (USHORT)rSelection.getLength();
+ nRows = nRows + (sal_uInt16)rSelection.getLength();
else
++nRows;
// prepare the array for the selected columns
- SwInsDBColumns_SAR aColFlds( 255 >= nCols ? (BYTE)nCols : 255, 5 );
+ SwInsDBColumns_SAR aColFlds( 255 >= nCols ? (sal_uInt8)nCols : 255, 5 );
for( n = 0; n < nCols; ++n )
{
- USHORT nFndPos;
+ sal_uInt16 nFndPos;
SwInsDBColumn aSrch( aLbTableCol.GetEntry( n ), 0 );
if( aDBColumns.Seek_Entry( &aSrch, &nFndPos ) )
aColFlds.Insert( aDBColumns[ nFndPos ], n );
@@ -1054,7 +1054,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
- BOOL bHTML = 0 != (::GetHtmlMode( pView->GetDocShell() ) & HTMLMODE_ON);
+ sal_Bool bHTML = 0 != (::GetHtmlMode( pView->GetDocShell() ) & HTMLMODE_ON);
rSh.InsertTable(
pModOpt->GetInsTblFlags(bHTML),
nRows, nCols, text::HoriOrientation::FULL, (pSelection ? pTAutoFmt : 0) );
@@ -1065,8 +1065,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
SfxItemSet aTblSet( rSh.GetAttrPool(), RES_BOXATR_FORMAT,
RES_BOXATR_VALUE );
- BOOL bIsAutoUpdateCells = rSh.IsAutoUpdateCells();
- rSh.SetAutoUpdateCells( FALSE );
+ sal_Bool bIsAutoUpdateCells = rSh.IsAutoUpdateCells();
+ rSh.SetAutoUpdateCells( sal_False );
if( aCbTableHeadon.IsChecked() )
@@ -1085,7 +1085,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
for( sal_Int32 i = 0 ; ; ++i )
{
- BOOL bBreak = FALSE;
+ sal_Bool bBreak = sal_False;
try
{
if(pSelection)
@@ -1099,7 +1099,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
catch(const Exception& )
{
- bBreak = TRUE;
+ bBreak = sal_True;
}
if(bBreak)
break;
@@ -1198,7 +1198,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
break;
if( 10 == i )
- pWait = ::std::auto_ptr<SwWait>(new SwWait( *pView->GetDocShell(), TRUE ));
+ pWait = ::std::auto_ptr<SwWait>(new SwWait( *pView->GetDocShell(), sal_True ));
}
rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() );
@@ -1228,7 +1228,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
rSh.SwCrsrShell::Left(1,CRSR_SKIP_CHARS);
}
- rSh.DoUndo( FALSE );
+ rSh.DoUndo( sal_False );
SwTxtFmtColl* pColl = 0;
{
@@ -1238,7 +1238,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
pColl = rSh.FindTxtFmtCollByName( sTmplNm );
if( !pColl )
{
- USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName( sTmplNm, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
+ sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sTmplNm, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if( USHRT_MAX != nId )
pColl = rSh.GetTxtCollFromPool( nId );
else
@@ -1282,12 +1282,12 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
C2S("1"), aEmptyStr, aDBData );
- BOOL bSetCrsr = TRUE;
- USHORT n = 0, nCols = aColArr.Count();
+ sal_Bool bSetCrsr = sal_True;
+ sal_uInt16 n = 0, nCols = aColArr.Count();
::sw::mark::IMark* pMark = NULL;
for( sal_Int32 i = 0 ; ; ++i )
{
- BOOL bBreak = FALSE;
+ sal_Bool bBreak = sal_False;
try
{
if(pSelection)
@@ -1301,7 +1301,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
catch(Exception&)
{
- bBreak = TRUE;
+ bBreak = sal_True;
}
if(bBreak)
@@ -1355,7 +1355,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
if(aStandard != aCompare)
nValue += (aStandard - aCompare);
}
- pFld->ChgValue( nValue, TRUE );
+ pFld->ChgValue( nValue, sal_True );
}
pFld->SetInitialized();
@@ -1408,13 +1408,13 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
rSh.SwCrsrShell::MovePara(
GetfnParaCurr(), GetfnParaEnd() );
- bSetCrsr = FALSE;
+ bSetCrsr = sal_False;
}
}
if( !pSelection )
{
- BOOL bNext = xResultSet->next();
+ sal_Bool bNext = xResultSet->next();
if(!bNext)
break;
}
@@ -1428,7 +1428,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
rSh.SwEditShell::SplitNode();
if( 10 == i )
- pWait = ::std::auto_ptr<SwWait>(new SwWait( *pView->GetDocShell(), TRUE ));
+ pWait = ::std::auto_ptr<SwWait>(new SwWait( *pView->GetDocShell(), sal_True ));
}
if( !bSetCrsr && pMark != NULL)
@@ -1442,11 +1442,11 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
// write configuration
Commit();
- }while( FALSE ); // middle checked loop
+ }while( sal_False ); // middle checked loop
if( bUndo )
{
- rSh.DoUndo( TRUE );
+ rSh.DoUndo( sal_True );
rSh.AppendUndoForInsertFromDB( bAsTable );
rSh.EndUndo( UNDO_EMPTY );
}
@@ -1481,15 +1481,15 @@ void SwInsertDBColAutoPilot::SetTabSet()
{
// remove the defaults again, it makes no sense to set them
SvxBrushItem aBrush( RES_BACKGROUND );
- static USHORT const aIds[3] =
+ static sal_uInt16 aIds[3] =
{ RES_BACKGROUND, SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE };
for( int i = 0; i < 3; ++i )
if( SFX_ITEM_SET == pTblSet->GetItemState( aIds[ i ],
- FALSE, &pItem ) && *pItem == aBrush )
+ sal_False, &pItem ) && *pItem == aBrush )
pTblSet->ClearItem( aIds[ i ] );
}
- if( SFX_ITEM_SET == pTblSet->GetItemState( FN_PARAM_TABLE_NAME, FALSE,
+ if( SFX_ITEM_SET == pTblSet->GetItemState( FN_PARAM_TABLE_NAME, sal_False,
&pItem ) && ((const SfxStringItem*)pItem)->GetValue() ==
rSh.GetTableFmt()->GetName() )
pTblSet->ClearItem( FN_PARAM_TABLE_NAME );
@@ -1630,7 +1630,7 @@ void SwInsertDBColAutoPilot::Commit()
pValues[3].Value <<= rtl::OUString(aEdDbText.GetText());
String sTmp;
- for( USHORT n = 0, nCnt = aLbTableCol.GetEntryCount(); n < nCnt; ++n )
+ for( sal_uInt16 n = 0, nCnt = aLbTableCol.GetEntryCount(); n < nCnt; ++n )
( sTmp += aLbTableCol.GetEntry( n ) ) += '\x0a';
if( sTmp.Len() )
@@ -1664,7 +1664,7 @@ void SwInsertDBColAutoPilot::Commit()
rtl::OUString sPrevLang;
SvNumberFormatter& rNFmtr = *pView->GetWrtShell().GetNumberFormatter();
- for(USHORT nCol = 0; nCol < aDBColumns.Count(); nCol++)
+ for(sal_uInt16 nCol = 0; nCol < aDBColumns.Count(); nCol++)
{
rtl::OUString sColumnNode = sNewNode;
SwInsDBColumn* pColumn = aDBColumns[nCol];
@@ -1773,7 +1773,7 @@ void SwInsertDBColAutoPilot::Load()
sal_Bool bFound = sal_False;
for(sal_Int32 nRealColumn = 0; nRealColumn < aDBColumns.Count(); nRealColumn++)
{
- if(aDBColumns[(USHORT)nRealColumn]->sColumn == sColumn)
+ if(aDBColumns[(sal_uInt16)nRealColumn]->sColumn == sColumn)
{
bFound = sal_True;
break;
@@ -1804,7 +1804,7 @@ void SwInsertDBColAutoPilot::Load()
pNewData->aDBColumns.Insert(pInsDBColumn);
}
- USHORT n = 0;
+ sal_uInt16 n = 0;
String sTmp( pNewData->sTblList );
if( sTmp.Len() )
{
@@ -1820,11 +1820,11 @@ void SwInsertDBColAutoPilot::Load()
if( !aLbTblDbColumn.GetEntryCount() )
{
- aIbDbcolAllTo.Enable( FALSE );
- aIbDbcolOneTo.Enable( FALSE );
+ aIbDbcolAllTo.Enable( sal_False );
+ aIbDbcolOneTo.Enable( sal_False );
}
- aIbDbcolOneFrom.Enable( TRUE );
- aIbDbcolAllFrom.Enable( TRUE );
+ aIbDbcolOneFrom.Enable( sal_True );
+ aIbDbcolAllFrom.Enable( sal_True );
}
aEdDbText.SetText( pNewData->sEdit );
@@ -1842,7 +1842,7 @@ void SwInsertDBColAutoPilot::Load()
// then load the AutoFmt file and look for Autoformat first
SwTableAutoFmtTbl aAutoFmtTbl;
aAutoFmtTbl.Load();
- for( USHORT nAutoFmt = aAutoFmtTbl.Count(); nAutoFmt; )
+ for( sal_uInt16 nAutoFmt = aAutoFmtTbl.Count(); nAutoFmt; )
if( sTmp == aAutoFmtTbl[ --nAutoFmt ]->GetName() )
{
pTAutoFmt = new SwTableAutoFmt( *aAutoFmtTbl[ nAutoFmt ] );
@@ -1864,14 +1864,14 @@ void SwInsertDBColAutoPilot::Load()
for( n = 0; n < aDBColumns.Count() ; ++n )
{
SwInsDBColumn& rSet = *aDBColumns[ n ];
- for( USHORT m = 0; m < pNewData->aDBColumns.Count() ; ++m )
+ for( sal_uInt16 m = 0; m < pNewData->aDBColumns.Count() ; ++m )
{
SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ];
if(rGet.sColumn == rSet.sColumn)
{
if( rGet.bHasFmt && !rGet.bIsDBFmt )
{
- rSet.bIsDBFmt = FALSE;
+ rSet.bIsDBFmt = sal_False;
rSet.nUsrNumFmt = rNFmtr.GetEntryKey( rGet.sUsrNumFmt,
rGet.eUsrNumFmtLng );
if( NUMBERFORMAT_ENTRY_NOT_FOUND == rSet.nUsrNumFmt )
@@ -1891,7 +1891,7 @@ void SwInsertDBColAutoPilot::Load()
// when the cursor is inside of a table, table must NEVER be selectable
if( !aRbAsTable.IsEnabled() && aRbAsTable.IsChecked() )
- aRbAsField.Check( TRUE );
+ aRbAsField.Check( sal_True );
delete pNewData;
break;
}
diff --git a/sw/source/ui/dbui/dbinsdlg.src b/sw/source/ui/dbui/dbinsdlg.src
index d08305dde1..5a3292d1d0 100644
--- a/sw/source/ui/dbui/dbinsdlg.src
+++ b/sw/source/ui/dbui/dbinsdlg.src
@@ -46,6 +46,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_AS_TABLE
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_TABLE";
Pos = MAP_APPFONT ( 80 , 6 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
TabStop = TRUE ;
@@ -54,6 +55,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_AS_FIELD
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_FIELD";
Pos = MAP_APPFONT ( 145 , 6 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
TabStop = TRUE ;
@@ -61,6 +63,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_AS_TEXT
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_AS_TEXT";
Pos = MAP_APPFONT ( 210 , 6 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
TabStop = TRUE ;
@@ -106,6 +109,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_DBFMT_FROM_DB
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_DBFMT_FROM_DB";
Pos = MAP_APPFONT ( 15 , 128 ) ;
Size = MAP_APPFONT ( 90 , 10 ) ;
TabStop = TRUE ;
@@ -114,12 +118,14 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_DBFMT_FROM_USR
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_DBFMT_FROM_USR";
Pos = MAP_APPFONT ( 15 , 143 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
TabStop = TRUE ;
};
ListBox LB_DBFMT_FROM_USR
{
+ HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_DBFMT_FROM_USR";
Border = TRUE ;
Pos = MAP_APPFONT ( 30 , 142 ) ;
Size = MAP_APPFONT ( 75 , 44 ) ;
@@ -130,6 +136,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
/* -------------- Page Text / Fields -------------------------------- */
ListBox LB_TXT_DB_COLUMN
{
+ HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TXT_DB_COLUMN";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 41 ) ;
Size = MAP_APPFONT ( 93 , 70 ) ;
@@ -138,6 +145,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ImageButton IB_DBCOL_TOEDIT
{
+ HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_TOEDIT";
Pos = MAP_APPFONT ( 111 , 41 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
TabStop = TRUE ;
@@ -153,6 +161,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
MultiLineEdit ED_DB_TEXT
{
+ HelpID = "sw:MultiLineEdit:DLG_AP_INSERT_DB_SEL:ED_DB_TEXT";
Border = TRUE ;
Pos = MAP_APPFONT ( 137 , 41 ) ;
Size = MAP_APPFONT ( 142 , 70 ) ;
@@ -172,6 +181,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ListBox LB_DB_PARA_COLL
{
+ HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_DB_PARA_COLL";
Border = TRUE ;
Pos = MAP_APPFONT ( 182 , 127 ) ;
Size = MAP_APPFONT ( 97 , 59 ) ;
@@ -183,6 +193,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
/* -------------- Page Table ---------------------------------------- */
ListBox LB_TBL_DB_COLUMN
{
+ HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TBL_DB_COLUMN";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 41 ) ;
Size = MAP_APPFONT ( 93 , 70 ) ;
@@ -190,6 +201,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ImageButton IB_DBCOL_ALL_TO
{
+ HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ALL_TO";
Pos = MAP_APPFONT ( 111 , 41 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
TabStop = TRUE ;
@@ -204,6 +216,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ImageButton IB_DBCOL_ONE_TO
{
+ HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ONE_TO";
Pos = MAP_APPFONT ( 111 , 56 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
TabStop = TRUE ;
@@ -218,6 +231,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ImageButton IB_DBCOL_ONE_FROM
{
+ HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ONE_FROM";
Pos = MAP_APPFONT ( 111 , 84 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
TabStop = TRUE ;
@@ -232,6 +246,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ImageButton IB_DBCOL_ALL_FROM
{
+ HelpID = "sw:ImageButton:DLG_AP_INSERT_DB_SEL:IB_DBCOL_ALL_FROM";
Pos = MAP_APPFONT ( 111 , 99 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
TabStop = TRUE ;
@@ -253,6 +268,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
ListBox LB_TABLE_COL
{
+ HelpID = "sw:ListBox:DLG_AP_INSERT_DB_SEL:LB_TABLE_COL";
Border = TRUE ;
Pos = MAP_APPFONT ( 137 , 41 ) ;
Size = MAP_APPFONT ( 75 , 70 ) ;
@@ -265,6 +281,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
CheckBox CB_TABLE_HEADON
{
+ HelpID = "sw:CheckBox:DLG_AP_INSERT_DB_SEL:CB_TABLE_HEADON";
Pos = MAP_APPFONT ( 111 , 128 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
TabStop = TRUE ;
@@ -273,6 +290,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_HEADL_COLNMS
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_HEADL_COLNMS";
Pos = MAP_APPFONT ( 120 , 142 ) ;
Size = MAP_APPFONT ( 90 , 10 ) ;
TabStop = TRUE ;
@@ -281,6 +299,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
RadioButton RB_HEADL_EMPTY
{
+ HelpID = "sw:RadioButton:DLG_AP_INSERT_DB_SEL:RB_HEADL_EMPTY";
Pos = MAP_APPFONT ( 120 , 155 ) ;
Size = MAP_APPFONT ( 90 , 10 ) ;
TabStop = TRUE ;
@@ -288,6 +307,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
PushButton PB_TBL_FORMAT
{
+ HelpID = "sw:PushButton:DLG_AP_INSERT_DB_SEL:PB_TBL_FORMAT";
Pos = MAP_APPFONT ( 214 , 128 ) ;
Size = MAP_APPFONT ( 65 , 12 ) ;
Text [ en-US ] = "Pr~operties..." ;
@@ -295,6 +315,7 @@ ModalDialog DLG_AP_INSERT_DB_SEL
};
PushButton PB_TBL_AUTOFMT
{
+ HelpID = "sw:PushButton:DLG_AP_INSERT_DB_SEL:PB_TBL_AUTOFMT";
Pos = MAP_APPFONT ( 214 , 144 ) ;
Size = MAP_APPFONT ( 65 , 12 ) ;
TabStop = TRUE ;
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index f23f6b50bc..60a7aad83e 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -61,10 +61,8 @@
#include <unotools/tempfile.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/urihelper.hxx>
-#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
-#endif
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/stritem.hxx>
@@ -85,7 +83,6 @@
#include <swundo.hxx>
#include <flddat.hxx>
#include <modcfg.hxx>
-#include <swprtopt.hxx>
#include <shellio.hxx>
#include <dbui.hxx>
#include <dbmgr.hxx>
@@ -135,6 +132,7 @@
#include <memory>
#include <vector>
#include <unomid.h>
+#include <section.hxx>
using namespace ::osl;
using namespace ::svx;
@@ -270,9 +268,9 @@ void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSource> xSou
}
}
-BOOL lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
+sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
try
{
if(pParam->bScrollable)
@@ -290,7 +288,7 @@ BOOL lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
return bRet;
}
-BOOL lcl_GetColumnCnt(SwDSParam* pParam,
+sal_Bool lcl_GetColumnCnt(SwDSParam* pParam,
const String& rColumnName, long nLanguage, String& rResult, double* pNumber)
{
uno::Reference< XColumnsSupplier > xColsSupp( pParam->xResultSet, UNO_QUERY );
@@ -303,7 +301,7 @@ BOOL lcl_GetColumnCnt(SwDSParam* pParam,
{
}
if(!xCols.is() || !xCols->hasByName(rColumnName))
- return FALSE;
+ return sal_False;
Any aCol = xCols->getByName(rColumnName);
uno::Reference< XPropertySet > xColumnProps;
aCol >>= xColumnProps;
@@ -321,13 +319,13 @@ BOOL lcl_GetColumnCnt(SwDSParam* pParam,
MsLangId::convertLanguageToLocale( (LanguageType)nLanguage, aFormatData.aLocale );
rResult = SwNewDBMgr::GetDBField( xColumnProps, aFormatData, pNumber);
- return TRUE;
+ return sal_True;
};
/*--------------------------------------------------------------------
Description: import data
--------------------------------------------------------------------*/
-BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
+sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
{
SetMergeType( rMergeDesc.nMergeType );
@@ -352,11 +350,11 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
if(!aData.sDataSource.getLength() || !aData.sCommand.getLength() || !xResSet.is())
{
- return FALSE;
+ return sal_False;
}
pImpl->pMergeData = new SwDSParam(aData, xResSet, aSelection);
- SwDSParam* pTemp = FindDSData(aData, FALSE);
+ SwDSParam* pTemp = FindDSData(aData, sal_False);
if(pTemp)
*pTemp = *pImpl->pMergeData;
else
@@ -366,7 +364,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
//DSData and set the correct CommandType
SwDBData aTempData(aData);
aData.nCommandType = -1;
- pTemp = FindDSData(aData, FALSE);
+ pTemp = FindDSData(aData, sal_False);
if(pTemp)
*pTemp = *pImpl->pMergeData;
else
@@ -397,7 +395,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
pImpl->pMergeData->bEndOfDB = !pImpl->pMergeData->xResultSet->absolute( nPos );
pImpl->pMergeData->CheckEndOfDB();
if(pImpl->pMergeData->nSelectionIndex >= pImpl->pMergeData->aSelection.getLength())
- pImpl->pMergeData->bEndOfDB = TRUE;
+ pImpl->pMergeData->bEndOfDB = sal_True;
}
else
{
@@ -407,7 +405,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
}
catch(Exception&)
{
- pImpl->pMergeData->bEndOfDB = TRUE;
+ pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
OSL_ENSURE(false, "exception in MergeNew()");
}
@@ -417,7 +415,7 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
lcl_InitNumberFormatter(*pImpl->pMergeData, xSource);
rMergeDesc.rSh.ChgDBData(aData);
- bInMerge = TRUE;
+ bInMerge = sal_True;
if (IsInitDBFields())
{
@@ -431,10 +429,10 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
sDBName += DB_DELIM;
sDBName += String::CreateFromInt32(aInsertData.nCommandType);
rMergeDesc.rSh.ChangeDBFields( aDBNames, sDBName);
- SetInitDBFields(FALSE);
+ SetInitDBFields(sal_False);
}
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
switch(rMergeDesc.nMergeType)
{
case DBMGR_MERGE:
@@ -464,16 +462,16 @@ BOOL SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
/*--------------------------------------------------------------------
Description: import data
--------------------------------------------------------------------*/
-BOOL SwNewDBMgr::Merge(SwWrtShell* pSh)
+sal_Bool SwNewDBMgr::Merge(SwWrtShell* pSh)
{
pSh->StartAllAction();
- pSh->ViewShell::UpdateFlds(TRUE);
+ pSh->ViewShell::UpdateFlds(sal_True);
pSh->SetModified();
pSh->EndAllAction();
- return TRUE;
+ return sal_True;
}
void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
@@ -483,8 +481,8 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
{
pSh->StartAllAction();
pSh->StartUndo(UNDO_EMPTY);
- BOOL bGroupUndo(pSh->DoesGroupUndo());
- pSh->DoGroupUndo(FALSE);
+ sal_Bool bGroupUndo(pSh->DoesGroupUndo());
+ pSh->DoGroupUndo(sal_False);
if( pSh->HasSelection() )
pSh->DelRight();
@@ -492,12 +490,12 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
SwWait *pWait = 0;
{
- ULONG i = 0;
+ sal_uLong i = 0;
do {
ImportDBEntry(pSh);
if( 10 == ++i )
- pWait = new SwWait( *pSh->GetView().GetDocShell(), TRUE);
+ pWait = new SwWait( *pSh->GetView().GetDocShell(), sal_True);
} while(ToNextMergeRecord());
}
@@ -510,10 +508,10 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh )
}
}
-String lcl_FindColumn(const String& sFormatStr,USHORT &nUsedPos, BYTE &nSeparator)
+String lcl_FindColumn(const String& sFormatStr,sal_uInt16 &nUsedPos, sal_uInt8 &nSeparator)
{
String sReturn;
- USHORT nLen = sFormatStr.Len();
+ sal_uInt16 nLen = sFormatStr.Len();
nSeparator = 0xff;
while(nUsedPos < nLen && nSeparator == 0xff)
{
@@ -548,13 +546,13 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh)
uno::Reference< XColumnsSupplier > xColsSupp( pImpl->pMergeData->xResultSet, UNO_QUERY );
uno::Reference<XNameAccess> xCols = xColsSupp->getColumns();
String sFormatStr;
- USHORT nFmtLen = sFormatStr.Len();
+ sal_uInt16 nFmtLen = sFormatStr.Len();
if( nFmtLen )
{
const char cSpace = ' ';
const char cTab = '\t';
- USHORT nUsedPos = 0;
- BYTE nSeparator;
+ sal_uInt16 nUsedPos = 0;
+ sal_uInt8 nSeparator;
String sColumn = lcl_FindColumn(sFormatStr, nUsedPos, nSeparator);
while( sColumn.Len() )
{
@@ -614,19 +612,20 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh)
/*--------------------------------------------------------------------
Description: fill Listbox with tablelist
--------------------------------------------------------------------*/
-BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
+sal_Bool SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
String sOldTableName(pListBox->GetSelectEntry());
pListBox->Clear();
- SwDSParam* pParam = FindDSConnection(rDBName, FALSE);
+ SwDSParam* pParam = FindDSConnection(rDBName, sal_False);
uno::Reference< XConnection> xConnection;
if(pParam && pParam->xConnection.is())
xConnection = pParam->xConnection;
else
{
rtl::OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ if ( sDBName.getLength() )
+ xConnection = RegisterConnection( sDBName );
}
if(xConnection.is())
{
@@ -638,7 +637,7 @@ BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
const rtl::OUString* pTbls = aTbls.getConstArray();
for(long i = 0; i < aTbls.getLength(); i++)
{
- USHORT nEntry = pListBox->InsertEntry(pTbls[i]);
+ sal_uInt16 nEntry = pListBox->InsertEntry(pTbls[i]);
pListBox->SetEntryData(nEntry, (void*)0);
}
}
@@ -650,13 +649,13 @@ BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
const rtl::OUString* pQueries = aQueries.getConstArray();
for(long i = 0; i < aQueries.getLength(); i++)
{
- USHORT nEntry = pListBox->InsertEntry(pQueries[i]);
+ sal_uInt16 nEntry = pListBox->InsertEntry(pQueries[i]);
pListBox->SetEntryData(nEntry, (void*)1);
}
}
if (sOldTableName.Len())
pListBox->SelectEntry(sOldTableName);
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
@@ -664,8 +663,8 @@ BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
/*--------------------------------------------------------------------
Description: fill Listbox with column names of a database
--------------------------------------------------------------------*/
-BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
- const String& rDBName, const String& rTableName, BOOL bAppend)
+sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
+ const String& rDBName, const String& rTableName, sal_Bool bAppend)
{
if (!bAppend)
pListBox->Clear();
@@ -673,7 +672,7 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
aData.sDataSource = rDBName;
aData.sCommand = rTableName;
aData.nCommandType = -1;
- SwDSParam* pParam = FindDSData(aData, FALSE);
+ SwDSParam* pParam = FindDSData(aData, sal_False);
uno::Reference< XConnection> xConnection;
if(pParam && pParam->xConnection.is())
xConnection = pParam->xConnection;
@@ -694,12 +693,12 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
}
::comphelper::disposeComponent( xColsSupp );
}
- return(TRUE);
+ return(sal_True);
}
-BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
+sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox,
uno::Reference< XConnection> xConnection,
- const String& rTableName, BOOL bAppend)
+ const String& rTableName, sal_Bool bAppend)
{
if (!bAppend)
pListBox->Clear();
@@ -715,7 +714,7 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
}
::comphelper::disposeComponent( xColsSupp );
}
- return(TRUE);
+ return(sal_True);
}
/*--------------------------------------------------------------------
@@ -723,10 +722,10 @@ BOOL SwNewDBMgr::GetColumnNames(ListBox* pListBox,
--------------------------------------------------------------------*/
SwNewDBMgr::SwNewDBMgr() :
nMergeType(DBMGR_INSERT),
- bInitDBFields(FALSE),
- bInMerge(FALSE),
- bMergeSilent(FALSE),
- bMergeLock(FALSE),
+ bInitDBFields(sal_False),
+ bInMerge(sal_False),
+ bMergeSilent(sal_False),
+ bMergeLock(sal_False),
pImpl(new SwNewDBMgr_Impl(*this)),
pMergeEvtSrc(NULL)
{
@@ -734,7 +733,7 @@ SwNewDBMgr::SwNewDBMgr() :
SwNewDBMgr::~SwNewDBMgr()
{
- for(USHORT nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
+ for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
{
SwDSParam* pParam = aDataSourceParams[nPos];
if(pParam->xConnection.is())
@@ -757,7 +756,7 @@ SwNewDBMgr::~SwNewDBMgr()
/*--------------------------------------------------------------------
Description: save bulk letters as single documents
--------------------------------------------------------------------*/
-String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageDesc, ULONG nDocNo )
+String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageDesc, sal_uLong nDocNo )
{
do
{
@@ -771,7 +770,7 @@ String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageD
void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget )
{
- USHORT aRangeOfDefaults[] = {
+ sal_uInt16 aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -782,8 +781,8 @@ void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget )
SfxItemSet aNewDefaults( rTarget.GetAttrPool(), aRangeOfDefaults );
- USHORT nWhich;
- USHORT nRange = 0;
+ sal_uInt16 nWhich;
+ sal_uInt16 nRange = 0;
while( aRangeOfDefaults[nRange] != 0)
{
for( nWhich = aRangeOfDefaults[nRange]; nWhich < aRangeOfDefaults[nRange + 1]; ++nWhich )
@@ -802,7 +801,7 @@ void lcl_CopyFollowPageDesc(
SwWrtShell& rTargetShell,
const SwPageDesc& rSourcePageDesc,
const SwPageDesc& rTargetPageDesc,
- const ULONG nDocNo )
+ const sal_uLong nDocNo )
{
//now copy the follow page desc, too
const SwPageDesc* pFollowPageDesc = rSourcePageDesc.GetFollow();
@@ -821,13 +820,30 @@ void lcl_CopyFollowPageDesc(
}
}
-BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
+void lcl_RemoveSectionLinks( SwWrtShell& rWorkShell )
+{
+ //reset all links of the sections of synchronized labels
+ sal_uInt16 nSections = rWorkShell.GetSectionFmtCount();
+ for( sal_uInt16 nSection = 0; nSection < nSections; ++nSection )
+ {
+ SwSectionData aSectionData( *rWorkShell.GetSectionFmt( nSection ).GetSection() );
+ if( aSectionData.GetType() == FILE_LINK_SECTION )
+ {
+ aSectionData.SetType( CONTENT_SECTION );
+ aSectionData.SetLinkFileName( String() );
+ rWorkShell.UpdateSection( nSection, aSectionData );
+ }
+ }
+ rWorkShell.SetLabelDoc( sal_False );
+}
+
+sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
const SwMergeDescriptor& rMergeDescriptor)
{
//check if the doc is synchronized and contains at least one linked section
- BOOL bSynchronizedDoc = pSourceShell->IsLabelDoc() && pSourceShell->GetSectionFmtCount() > 1;
- BOOL bLoop = TRUE;
- BOOL bEMail = rMergeDescriptor.nMergeType == DBMGR_MERGE_MAILING;
+ sal_Bool bSynchronizedDoc = pSourceShell->IsLabelDoc() && pSourceShell->GetSectionFmtCount() > 1;
+ sal_Bool bLoop = sal_True;
+ sal_Bool bEMail = rMergeDescriptor.nMergeType == DBMGR_MERGE_MAILING;
const bool bAsSingleFile = rMergeDescriptor.nMergeType == DBMGR_MERGE_SINGLE_FILE;
::rtl::Reference< MailDispatcher > xMailDispatcher;
@@ -852,14 +868,14 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
uno::Reference< XPropertySet > xColumnProp;
{
- BOOL bColumnName = sEMailAddrFld.Len() > 0;
+ sal_Bool bColumnName = sEMailAddrFld.Len() > 0;
if (bColumnName)
{
uno::Reference< XColumnsSupplier > xColsSupp( pImpl->pMergeData->xResultSet, UNO_QUERY );
uno::Reference<XNameAccess> xCols = xColsSupp->getColumns();
if(!xCols->hasByName(sEMailAddrFld))
- return FALSE;
+ return sal_False;
Any aCol = xCols->getByName(sEMailAddrFld);
aCol >>= xColumnProp;
}
@@ -895,16 +911,20 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
pStoreToFilterOptions = &rMergeDescriptor.sSaveToFilterOptions;
}
}
- bCancel = FALSE;
+ bCancel = sal_False;
// in case of creating a single resulting file this has to be created here
SwWrtShell* pTargetShell = 0;
- SfxObjectShellRef xTargetDocShell;
+
+ // the shell will be explicitly closed at the end of the method, but it is
+ // still more safe to use SfxObjectShellLock here
+ SfxObjectShellLock xTargetDocShell;
+
SwView* pTargetView = 0;
std::auto_ptr< utl::TempFile > aTempFile;
String sModifiedStartingPageDesc;
String sStartingPageDesc;
- USHORT nStartingPageNo = 0;
+ sal_uInt16 nStartingPageNo = 0;
bool bPageStylesWithHeaderFooter = false;
if(bAsSingleFile || rMergeDescriptor.bCreateSingleFile)
{
@@ -928,7 +948,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
pTargetView->GetDocShell()->LoadStylesFromFile(
sSourceDocumentURL, aOpt, sal_True );
//determine the page style and number used at the start of the source document
- pSourceShell->SttEndDoc(TRUE);
+ pSourceShell->SttEndDoc(sal_True);
nStartingPageNo = pSourceShell->GetVirtPageNum();
sStartingPageDesc = sModifiedStartingPageDesc = pSourceShell->GetPageDesc(
pSourceShell->GetCurPageDesc()).GetName();
@@ -958,10 +978,10 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh);
while (pViewFrm)
{
- pViewFrm->GetDispatcher()->Lock(TRUE);
+ pViewFrm->GetDispatcher()->Lock(sal_True);
pViewFrm = SfxViewFrame::GetNext(*pViewFrm, pSourrceDocSh);
}
- ULONG nDocNo = 1;
+ sal_uLong nDocNo = 1;
long nStartRow, nEndRow;
// collect temporary files
@@ -1007,8 +1027,8 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
if( !aTempFile->IsValid() )
{
ErrorHandler::HandleError( ERRCODE_IO_NOTSUPPORTED );
- bLoop = FALSE;
- bCancel = TRUE;
+ bLoop = sal_False;
+ bCancel = sal_True;
}
else
{
@@ -1020,12 +1040,13 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
aPrtMonDlg.aPrintInfo.SetText(sStat);
// computation time for Save-Monitor:
- for (USHORT i = 0; i < 10; i++)
+ for (sal_uInt16 i = 0; i < 10; i++)
Application::Reschedule();
- // create and save new document
- SfxObjectShellRef xWorkDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
- SfxMedium* pWorkMed = new SfxMedium( sSourceDocumentURL, STREAM_STD_READ, TRUE );
+ // Create and save new document
+ // The SfxObjectShell will be closed explicitly later but it is more safe to use SfxObjectShellLock here
+ SfxObjectShellLock xWorkDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
+ SfxMedium* pWorkMed = new SfxMedium( sSourceDocumentURL, STREAM_STD_READ, sal_True );
pWorkMed->SetFilter( pSfxFlt );
if (xWorkDocSh->DoLoad(pWorkMed))
@@ -1060,12 +1081,16 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
// copy created file into the target document
rWorkShell.ConvertFieldsToText();
rWorkShell.SetNumberingRestart();
+ if( bSynchronizedDoc )
+ {
+ lcl_RemoveSectionLinks( rWorkShell );
+ }
// insert the document into the target document
- rWorkShell.SttEndDoc(FALSE);
- rWorkShell.SttEndDoc(TRUE);
+ rWorkShell.SttEndDoc(sal_False);
+ rWorkShell.SttEndDoc(sal_True);
rWorkShell.SelAll();
- pTargetShell->SwCrsrShell::SttEndDoc( FALSE );
+ pTargetShell->SwCrsrShell::SttEndDoc( sal_False );
//#i72517# the headers and footers are still those from the source - update in case of fields inside header/footer
if( !nDocNo && bPageStylesWithHeaderFooter )
pTargetShell->GetView().GetDocShell()->_LoadStyles( *rWorkShell.GetView().GetDocShell(), sal_True );
@@ -1119,7 +1144,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
String sFileURL = aTempFileURL.GetMainURL( INetURLObject::NO_DECODE );
SfxMedium* pDstMed = new SfxMedium(
sFileURL,
- STREAM_STD_READWRITE, TRUE );
+ STREAM_STD_READWRITE, sal_True );
pDstMed->SetFilter( pStoreToFilter );
if(pDstMed->GetItemSet())
{
@@ -1139,8 +1164,8 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
{
// error message ??
ErrorHandler::HandleError( xWorkDocSh->GetError() );
- bCancel = TRUE;
- bLoop = FALSE;
+ bCancel = sal_True;
+ bLoop = sal_False;
}
if( bEMail )
{
@@ -1176,7 +1201,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
{
{
//read in the temporary file and use it as mail body
- SfxMedium aMedium( sFileURL, STREAM_READ, TRUE);
+ SfxMedium aMedium( sFileURL, STREAM_READ, sal_True);
SvStream* pInStream = aMedium.GetInStream();
OSL_ENSURE(pInStream, "no output file created?");
if(pInStream)
@@ -1230,7 +1255,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
} while( !bCancel &&
(bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord()));
- aPrtMonDlg.Show( FALSE );
+ aPrtMonDlg.Show( sal_False );
// save the single output document
if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile)
@@ -1241,7 +1266,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL());
SfxMedium* pDstMed = new SfxMedium(
aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
- STREAM_STD_READWRITE, TRUE );
+ STREAM_STD_READWRITE, sal_True );
pDstMed->SetFilter( pStoreToFilter );
if(pDstMed->GetItemSet())
{
@@ -1257,7 +1282,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
{
// error message ??
ErrorHandler::HandleError( xTargetDocShell->GetError() );
- bLoop = FALSE;
+ bLoop = sal_False;
}
}
else if( pTargetView ) // must be available!
@@ -1315,7 +1340,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh);
while (pViewFrm)
{
- pViewFrm->GetDispatcher()->Lock(FALSE);
+ pViewFrm->GetDispatcher()->Lock(sal_False);
pViewFrm = SfxViewFrame::GetNext(*pViewFrm, pSourrceDocSh);
}
@@ -1338,7 +1363,7 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
{
pButton->GetParent()->Hide();
- bCancel = TRUE;
+ bCancel = sal_True;
return 0;
}
IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
@@ -1347,13 +1372,13 @@ IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton )
Description: determine the column's Numberformat and transfer
to the forwarded Formatter, if applicable.
--------------------------------------------------------------------*/
-ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName,
+sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName,
const String& rTableName,
const String& rColNm,
SvNumberFormatter* pNFmtr,
long nLanguage )
{
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if(pNFmtr)
{
uno::Reference< XDataSource> xSource;
@@ -1375,7 +1400,7 @@ ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName,
aData.sDataSource = rDBName;
aData.sCommand = rTableName;
aData.nCommandType = -1;
- SwDSParam* pParam = FindDSData(aData, FALSE);
+ SwDSParam* pParam = FindDSData(aData, sal_False);
if(pParam && pParam->xConnection.is())
{
xConnection = pParam->xConnection;
@@ -1427,19 +1452,20 @@ ULONG SwNewDBMgr::GetColumnFmt( const String& rDBName,
return nRet;
}
-ULONG SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
+sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
uno::Reference< XConnection> xConnection,
uno::Reference< XPropertySet> xColumn,
SvNumberFormatter* pNFmtr,
long nLanguage )
{
// set the NumberFormat in the doc if applicable
- ULONG nRet = 0;
+ sal_uLong nRet = 0;
if(!xSource.is())
{
uno::Reference<XChild> xChild(xConnection, UNO_QUERY);
- xSource = uno::Reference<XDataSource>(xChild->getParent(), UNO_QUERY);
+ if ( xChild.is() )
+ xSource = uno::Reference<XDataSource>(xChild->getParent(), UNO_QUERY);
}
if(xSource.is() && xConnection.is() && xColumn.is() && pNFmtr)
{
@@ -1517,7 +1543,7 @@ sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName,
aData.sDataSource = rDBName;
aData.sCommand = rTableName;
aData.nCommandType = -1;
- SwDSParam* pParam = FindDSData(aData, FALSE);
+ SwDSParam* pParam = FindDSData(aData, sal_False);
uno::Reference< XConnection> xConnection;
uno::Reference< XColumnsSupplier > xColsSupp;
bool bDispose = false;
@@ -1576,7 +1602,7 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData
uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Reference<sdbc::XConnection> xConnection,
const String& rTableOrQuery,
- BYTE eTableOrQuery)
+ sal_uInt8 eTableOrQuery)
{
Reference< sdbcx::XColumnsSupplier> xRet;
try
@@ -1668,7 +1694,7 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
try
{
SwDbtoolsClient& aClient = SwNewDBMgr::GetDbtoolsClient();
- sRet = aClient.getValue(
+ sRet = aClient.getFormattedValue(
xColumnProps,
rDBFormatData.xFormatter,
rDBFormatData.aLocale,
@@ -1698,13 +1724,13 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
void SwNewDBMgr::EndMerge()
{
OSL_ENSURE(bInMerge, "merge is not active");
- bInMerge = FALSE;
+ bInMerge = sal_False;
delete pImpl->pMergeData;
pImpl->pMergeData = 0;
}
// checks if a desired data source table or query is open
-BOOL SwNewDBMgr::IsDataSourceOpen(const String& rDataSource,
+sal_Bool SwNewDBMgr::IsDataSourceOpen(const String& rDataSource,
const String& rTableOrQuery, sal_Bool bMergeOnly)
{
if(pImpl->pMergeData)
@@ -1722,19 +1748,19 @@ BOOL SwNewDBMgr::IsDataSourceOpen(const String& rDataSource,
aData.sDataSource = rDataSource;
aData.sCommand = rTableOrQuery;
aData.nCommandType = -1;
- SwDSParam* pFound = FindDSData(aData, FALSE);
+ SwDSParam* pFound = FindDSData(aData, sal_False);
return (pFound && pFound->xResultSet.is());
}
return sal_False;
}
// read column data at a specified position
-BOOL SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableName,
+sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableName,
const String& rColumnName, sal_uInt32 nAbsRecordId,
long nLanguage,
String& rResult, double* pNumber)
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
SwDSParam* pFound = 0;
//check if it's the merge data source
if(pImpl->pMergeData &&
@@ -1749,7 +1775,7 @@ BOOL SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableNam
aData.sDataSource = rSourceName;
aData.sCommand = rTableName;
aData.nCommandType = -1;
- pFound = FindDSData(aData, FALSE);
+ pFound = FindDSData(aData, sal_False);
}
//check validity of supplied record Id
if(pFound->aSelection.getLength())
@@ -1765,7 +1791,7 @@ BOOL SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableNam
bFound = sal_True;
}
if(!bFound)
- return FALSE;
+ return sal_False;
}
if(pFound && pFound->xResultSet.is() && !pFound->bAfterSelection)
{
@@ -1776,10 +1802,10 @@ BOOL SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableNam
}
catch(const Exception& )
{
- return FALSE;
+ return sal_False;
}
//position to the desired index
- BOOL bMove = TRUE;
+ sal_Bool bMove = sal_True;
if ( nOldRow != static_cast<sal_Int32>(nAbsRecordId) )
bMove = lcl_MoveAbsolute(pFound, nAbsRecordId);
if(bMove)
@@ -1794,26 +1820,26 @@ BOOL SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableNam
// reads the column data at the current position
-BOOL SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, USHORT nLanguage,
+sal_Bool SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, sal_uInt16 nLanguage,
String &rResult, double *pNumber, sal_uInt32 * /*pFormat*/)
{
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is() || pImpl->pMergeData->bAfterSelection )
{
rResult.Erase();
- return FALSE;
+ return sal_False;
}
- BOOL bRet = lcl_GetColumnCnt(pImpl->pMergeData, rColumnName, nLanguage, rResult, pNumber);
+ sal_Bool bRet = lcl_GetColumnCnt(pImpl->pMergeData, rColumnName, nLanguage, rResult, pNumber);
return bRet;
}
-BOOL SwNewDBMgr::ToNextMergeRecord()
+sal_Bool SwNewDBMgr::ToNextMergeRecord()
{
OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
return ToNextRecord(pImpl->pMergeData);
}
-BOOL SwNewDBMgr::ToNextRecord(
+sal_Bool SwNewDBMgr::ToNextRecord(
const String& rDataSource, const String& rCommand, sal_Int32 /*nCommandType*/)
{
SwDSParam* pFound = 0;
@@ -1827,20 +1853,20 @@ BOOL SwNewDBMgr::ToNextRecord(
aData.sDataSource = rDataSource;
aData.sCommand = rCommand;
aData.nCommandType = -1;
- pFound = FindDSData(aData, FALSE);
+ pFound = FindDSData(aData, sal_False);
}
return ToNextRecord(pFound);
}
-BOOL SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
+sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
{
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if(!pParam || !pParam->xResultSet.is() || pParam->bEndOfDB ||
(pParam->aSelection.getLength() && pParam->aSelection.getLength() <= pParam->nSelectionIndex))
{
if(pParam)
pParam->CheckEndOfDB();
- return FALSE;
+ return sal_False;
}
try
{
@@ -1852,7 +1878,7 @@ BOOL SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
pParam->CheckEndOfDB();
bRet = !pParam->bEndOfDB;
if(pParam->nSelectionIndex >= pParam->aSelection.getLength())
- pParam->bEndOfDB = TRUE;
+ pParam->bEndOfDB = sal_True;
}
else
{
@@ -1880,7 +1906,7 @@ BOOL SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
to assure that the next page can be created in mail merge
the cursor position must be validated
---------------------------------------------------------------------------*/
-BOOL SwNewDBMgr::ExistsNextRecord() const
+sal_Bool SwNewDBMgr::ExistsNextRecord() const
{
return pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB;
}
@@ -1890,7 +1916,7 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId()
sal_uInt32 nRet = 0;
OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is())
- return FALSE;
+ return sal_False;
try
{
nRet = pImpl->pMergeData->xResultSet->getRow();
@@ -1905,8 +1931,8 @@ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet)
{
OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge");
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is()|| nSet < 0)
- return FALSE;
- sal_Bool bRet = FALSE;
+ return sal_False;
+ sal_Bool bRet = sal_False;
sal_Int32 nAbsPos = nSet;
if(nAbsPos >= 0)
@@ -1918,7 +1944,7 @@ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet)
return bRet;
}
-BOOL SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableOrQuery,
+sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableOrQuery,
sal_Int32 nCommandType, bool bCreate)
{
SwDBData aData;
@@ -1926,11 +1952,11 @@ BOOL SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableO
aData.sCommand = rTableOrQuery;
aData.nCommandType = nCommandType;
- SwDSParam* pFound = FindDSData(aData, TRUE);
+ SwDSParam* pFound = FindDSData(aData, sal_True);
uno::Reference< XDataSource> xSource;
if(pFound->xResultSet.is())
- return TRUE;
- SwDSParam* pParam = FindDSConnection(rDataSource, FALSE);
+ return sal_True;
+ SwDSParam* pParam = FindDSConnection(rDataSource, sal_False);
uno::Reference< XConnection> xConnection;
if(pParam && pParam->xConnection.is())
pFound->xConnection = pParam->xConnection;
@@ -1952,7 +1978,7 @@ BOOL SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableO
catch(Exception&)
{
// DB driver may not be ODBC 3.0 compliant
- pFound->bScrollable = TRUE;
+ pFound->bScrollable = sal_True;
}
pFound->xStatement = pFound->xConnection->createStatement();
rtl::OUString aQuoteChar = xMetaData->getIdentifierQuoteString();
@@ -1981,7 +2007,7 @@ BOOL SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableO
uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rDataSource)
{
- SwDSParam* pFound = SwNewDBMgr::FindDSConnection(rDataSource, TRUE);
+ SwDSParam* pFound = SwNewDBMgr::FindDSConnection(rDataSource, sal_True);
uno::Reference< XDataSource> xSource;
if(!pFound->xConnection.is())
{
@@ -2015,7 +2041,7 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId(
aData.sDataSource = rDataSource;
aData.sCommand = rTableOrQuery;
aData.nCommandType = nCommandType;
- SwDSParam* pFound = FindDSData(aData, FALSE);
+ SwDSParam* pFound = FindDSData(aData, sal_False);
if(pFound && pFound->xResultSet.is())
{
try
@@ -2039,11 +2065,11 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId(
// close all data sources - after fields were updated
-void SwNewDBMgr::CloseAll(BOOL bIncludingMerge)
+void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge)
{
//the only thing done here is to reset the selection index
//all connections stay open
- for(USHORT nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
+ for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
{
SwDSParam* pParam = aDataSourceParams[nPos];
if(bIncludingMerge || pParam != pImpl->pMergeData)
@@ -2062,7 +2088,7 @@ void SwNewDBMgr::CloseAll(BOOL bIncludingMerge)
}
}
-SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, BOOL bCreate)
+SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate)
{
//prefer merge data if available
if(pImpl->pMergeData && rData.sDataSource == pImpl->pMergeData->sDataSource &&
@@ -2074,7 +2100,7 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, BOOL bCreate)
}
SwDSParam* pFound = 0;
- for(USHORT nPos = aDataSourceParams.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = aDataSourceParams.Count(); nPos; nPos--)
{
SwDSParam* pParam = aDataSourceParams[nPos - 1];
if(rData.sDataSource == pParam->sDataSource &&
@@ -2111,7 +2137,7 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, BOOL bCreate)
return pFound;
}
-SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, BOOL bCreate)
+SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_Bool bCreate)
{
//prefer merge data if available
if(pImpl->pMergeData && rDataSource == pImpl->pMergeData->sDataSource )
@@ -2119,7 +2145,7 @@ SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, BOOL
return pImpl->pMergeData;
}
SwDSParam* pFound = 0;
- for(USHORT nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
+ for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
{
SwDSParam* pParam = aDataSourceParams[nPos];
if(rDataSource == pParam->sDataSource)
@@ -2361,7 +2387,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
const Sequence<PropertyValue>& rProperties,
- BOOL bWithDataSourceBrowser)
+ sal_Bool bWithDataSourceBrowser)
{
//prevent second call
if(pImpl->pMergeDialog)
@@ -2393,7 +2419,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
if(!xConnection.is())
{
xConnection = SwNewDBMgr::RegisterConnection(sDataSource);
- pFound = FindDSConnection(sDataSource, TRUE);
+ pFound = FindDSConnection(sDataSource, sal_True);
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -2413,6 +2439,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
if(xResSet.is())
aDescriptor[daCursor] <<= xResSet;
+ // SfxObjectShellRef is ok, since there should be no control over the document lifetime here
SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame()->GetObjectShell();
SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xDocShell));
{
@@ -2443,8 +2470,10 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
}
else
{
- SfxObjectShellRef xWorkDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
- SfxMedium* pWorkMed = new SfxMedium( sTempURL, STREAM_STD_READ, TRUE );
+ // the shell will be explicitly closed, but it is more safe to use SfxObjectShellLock here
+ // especially for the case that the loading has failed
+ SfxObjectShellLock xWorkDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
+ SfxMedium* pWorkMed = new SfxMedium( sTempURL, STREAM_STD_READ, sal_True );
pWorkMed->SetFilter( pSfxFlt );
if( xWorkDocSh->DoLoad(pWorkMed) )
{
@@ -2489,7 +2518,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
}
if(pFound)
{
- for(USHORT nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
+ for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
{
SwDSParam* pParam = aDataSourceParams[nPos];
if(pParam == pFound)
@@ -2664,7 +2693,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
uno::Reference< XResultSet> xResultSet = rMMConfig.GetResultSet();
if(!xResultSet.is())
return false;
- bInMerge = TRUE;
+ bInMerge = sal_True;
sal_Int32 nRet = 0;
pImpl->pMergeData = new SwDSParam(
rMMConfig.GetCurrentDBData(), xResultSet, rMMConfig.GetSelection());
@@ -2678,7 +2707,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pImpl->pMergeData->bEndOfDB = !pImpl->pMergeData->xResultSet->absolute( nPos );
pImpl->pMergeData->CheckEndOfDB();
if(pImpl->pMergeData->nSelectionIndex >= pImpl->pMergeData->aSelection.getLength())
- pImpl->pMergeData->bEndOfDB = TRUE;
+ pImpl->pMergeData->bEndOfDB = sal_True;
}
else
{
@@ -2688,13 +2717,13 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
catch(Exception&)
{
- pImpl->pMergeData->bEndOfDB = TRUE;
+ pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
OSL_ENSURE(false, "exception in MergeNew()");
}
//bCancel is set from the PrintMonitor
- bCancel = FALSE;
+ bCancel = sal_False;
CreateMonitor aMonitorDlg(&rSourceView.GetEditWin());
aMonitorDlg.SetCancelHdl(LINK(this, SwNewDBMgr, PrtCancelHdl));
@@ -2704,15 +2733,15 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
aMonitorDlg.Invalidate();
aMonitorDlg.Update();
// the print monitor needs some time to act
- for( USHORT i = 0; i < 25; i++)
+ for( sal_uInt16 i = 0; i < 25; i++)
Application::Reschedule();
}
SwWrtShell& rSourceShell = rSourceView.GetWrtShell();
- BOOL bSynchronizedDoc = rSourceShell.IsLabelDoc() && rSourceShell.GetSectionFmtCount() > 1;
+ sal_Bool bSynchronizedDoc = rSourceShell.IsLabelDoc() && rSourceShell.GetSectionFmtCount() > 1;
//save the settings of the first
- rSourceShell.SttEndDoc(TRUE);
- USHORT nStartingPageNo = rSourceShell.GetVirtPageNum();
+ rSourceShell.SttEndDoc(sal_True);
+ sal_uInt16 nStartingPageNo = rSourceShell.GetVirtPageNum();
String sModifiedStartingPageDesc;
String sStartingPageDesc = sModifiedStartingPageDesc = rSourceShell.GetPageDesc(
rSourceShell.GetCurPageDesc()).GetName();
@@ -2748,7 +2777,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
long nStartRow, nEndRow;
- ULONG nDocNo = 1;
+ sal_uLong nDocNo = 1;
sal_Int32 nDocCount = 0;
if( !IsMergeSilent() && lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) )
aMonitorDlg.SetTotalCount( nDocCount );
@@ -2762,12 +2791,13 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
aMonitorDlg.Invalidate();
aMonitorDlg.Update();
// the print monitor needs some time to act
- for( USHORT i = 0; i < 25; i++)
+ for( sal_uInt16 i = 0; i < 25; i++)
Application::Reschedule();
}
// copy the source document
- SfxObjectShellRef xWorkDocSh;
+ // the copy will be closed later, but it is more safe to use SfxObjectShellLock here
+ SfxObjectShellLock xWorkDocSh;
if(nDocNo == 1 )
{
uno::Reference< util::XCloneable > xClone( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
@@ -2789,8 +2819,14 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
pWorkDoc->SetNewDBMgr( this );
pWorkDoc->EmbedAllLinks();
- if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
- rWorkShell.Undo();
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (rWorkShell.GetLastUndoInfo(0, & nLastUndoId))
+ {
+ if (UNDO_UI_DELETE_INVISIBLECNTNT == nLastUndoId)
+ {
+ rWorkShell.Undo();
+ }
+ }
// #i69485# lock fields to prevent access to the result set while calculating layout
rWorkShell.LockExpFlds();
// create a layout
@@ -2804,13 +2840,16 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
rWorkShell.RemoveInvisibleContent();
rWorkShell.ConvertFieldsToText();
rWorkShell.SetNumberingRestart();
-
+ if( bSynchronizedDoc )
+ {
+ lcl_RemoveSectionLinks( rWorkShell );
+ }
// insert the document into the target document
- rWorkShell.SttEndDoc(FALSE);
- rWorkShell.SttEndDoc(TRUE);
+ rWorkShell.SttEndDoc(sal_False);
+ rWorkShell.SttEndDoc(sal_True);
rWorkShell.SelAll();
- pTargetShell->SttEndDoc(FALSE);
+ pTargetShell->SttEndDoc(sal_False);
//#i63806# put the styles to the target document
//if the source uses headers or footers each new copy need to copy a new page styles
@@ -2844,7 +2883,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
{
pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
}
- USHORT nPageCountBefore = pTargetShell->GetPageCnt();
+ sal_uInt16 nPageCountBefore = pTargetShell->GetPageCnt();
OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
//#i51359# add a second paragraph in case there's only one
{
@@ -2875,7 +2914,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
++nRet;
// the print monitor needs some time to act
- for( USHORT i = 0; i < 25; i++)
+ for( sal_uInt16 i = 0; i < 25; i++)
Application::Reschedule();
//restore the ole DBMgr
@@ -2906,7 +2945,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
OSL_ENSURE(false, "exception caught in SwNewDBMgr::MergeDocuments");
}
DELETEZ(pImpl->pMergeData);
- bInMerge = FALSE;
+ bInMerge = sal_False;
return nRet;
}
@@ -2924,7 +2963,7 @@ void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource )
{
::SolarMutexGuard aGuard;
uno::Reference<XConnection> xSource(rSource.Source, UNO_QUERY);
- for(USHORT nPos = rDBMgr.aDataSourceParams.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = rDBMgr.aDataSourceParams.Count(); nPos; nPos--)
{
SwDSParam* pParam = rDBMgr.aDataSourceParams[nPos - 1];
if(pParam->xConnection.is() &&
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 96d95a85d0..3595e44fc5 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -95,7 +95,7 @@ class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener >
virtual void SAL_CALL elementReplaced( const ContainerEvent& Event ) throw (RuntimeException);
virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException);
- BOOL HasContext();
+ sal_Bool HasContext();
SwWrtShell* GetWrtShell() { return pWrtSh;}
void SetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;}
Reference< XNameAccess > GetContext() const {return xDBContext;}
@@ -127,7 +127,7 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru
SolarMutexGuard aGuard;
::rtl::OUString sSource;
rEvent.Accessor >>= sSource;
- for(USHORT i = 0; i < aConnections.Count(); i++)
+ for(sal_uInt16 i = 0; i < aConnections.Count(); i++)
{
SwConnectionDataPtr pPtr = aConnections[i];
if(pPtr->sSourceName == sSource)
@@ -148,7 +148,7 @@ void SwDBTreeList_Impl::elementReplaced( const ContainerEvent& rEvent ) throw (R
elementRemoved(rEvent);
}
-BOOL SwDBTreeList_Impl::HasContext()
+sal_Bool SwDBTreeList_Impl::HasContext()
{
if(!xDBContext.is())
{
@@ -170,7 +170,7 @@ BOOL SwDBTreeList_Impl::HasContext()
Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rSourceName)
{
Reference<XConnection> xRet;
- for(USHORT i = 0; i < aConnections.Count(); i++)
+ for(sal_uInt16 i = 0; i < aConnections.Count(); i++)
{
SwConnectionDataPtr pPtr = aConnections[i];
if(pPtr->sSourceName == rSourceName)
@@ -191,12 +191,12 @@ Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rS
SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
SwWrtShell* pSh,
- const String& rDefDBName, const BOOL bShowCol):
+ const String& rDefDBName, const sal_Bool bShowCol):
SvTreeListBox (pParent, rResId),
aImageList (SW_RES(ILIST_DB_DLG )),
sDefDBName (rDefDBName),
- bInitialized (FALSE),
+ bInitialized (sal_False),
bShowColumns (bShowCol),
pImpl(new SwDBTreeList_Impl(pSh))
{
@@ -216,7 +216,7 @@ void SwDBTreeList::InitTreeList()
if(!pImpl->HasContext() && pImpl->GetWrtShell())
return;
SetSelectionMode(SINGLE_SELECTION);
- SetWindowBits(WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
// don't set font, so that the Control's font is being applied!
SetSpaceBetweenEntries(0);
SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
@@ -234,24 +234,24 @@ void SwDBTreeList::InitTreeList()
for(long i = 0; i < nCount; i++)
{
String sDBName(pDBNames[i]);
- InsertEntry(sDBName, aImg, aImg, NULL, TRUE);
+ InsertEntry(sDBName, aImg, aImg, NULL, sal_True);
}
String sDBName(sDefDBName.GetToken(0, DB_DELIM));
String sTableName(sDefDBName.GetToken(1, DB_DELIM));
String sColumnName(sDefDBName.GetToken(2, DB_DELIM));
Select(sDBName, sTableName, sColumnName);
- bInitialized = TRUE;
+ bInitialized = sal_True;
}
void SwDBTreeList::AddDataSource(const String& rSource)
{
Image aImg = aImageList.GetImage(IMG_DB);
- SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, TRUE);
+ SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True);
SvTreeListBox::Select(pEntry);
}
-void SwDBTreeList::ShowColumns(BOOL bShowCol)
+void SwDBTreeList::ShowColumns(sal_Bool bShowCol)
{
if (bShowCol != bShowColumns)
{
@@ -259,7 +259,7 @@ void SwDBTreeList::ShowColumns(BOOL bShowCol)
String sTableName, sColumnName;
String sDBName(GetDBName(sTableName, sColumnName));
- SetUpdateMode(FALSE);
+ SetUpdateMode(sal_False);
SvLBoxEntry* pEntry = First();
@@ -279,7 +279,7 @@ void SwDBTreeList::ShowColumns(BOOL bShowCol)
{
Select(sDBName, sTableName, sColumnName); // force RequestingChilds
}
- SetUpdateMode(TRUE);
+ SetUpdateMode(sal_True);
}
}
@@ -298,7 +298,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
if(!pImpl->GetContext()->hasByName(sSourceName))
return;
Reference<XConnection> xConnection = pImpl->GetConnection(sSourceName);
- BOOL bTable = pParent->GetUserData() == 0;
+ sal_Bool bTable = pParent->GetUserData() == 0;
Reference<XColumnsSupplier> xColsSupplier;
if(bTable)
{
@@ -420,7 +420,7 @@ IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData )
return DefaultCompare(pData); // otherwise call base class
}
-String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, BOOL* pbIsTable)
+String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Bool* pbIsTable)
{
String sDBName;
SvLBoxEntry* pEntry = FirstSelected();
@@ -449,8 +449,8 @@ void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const
{
SvLBoxEntry* pParent;
SvLBoxEntry* pChild;
- USHORT nParent = 0;
- USHORT nChild = 0;
+ sal_uInt16 nParent = 0;
+ sal_uInt16 nChild = 0;
while ((pParent = GetEntry(nParent++)) != NULL)
{
diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src
index ce6b297064..b13e870604 100644
--- a/sw/source/ui/dbui/dbui.src
+++ b/sw/source/ui/dbui/dbui.src
@@ -31,6 +31,7 @@
ModalDialog DLG_DBSELECTION
{
+ HelpID = "sw:ModalDialog:DLG_DBSELECTION";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 168 , 132 ) ;
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index 610903c445..441373b525 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star;
SFX_IMPL_FLOATINGWINDOW( SwMailMergeChildWindow, FN_MAILMERGE_CHILDWINDOW )
SwMailMergeChildWindow::SwMailMergeChildWindow( Window* _pParent,
- USHORT nId,
+ sal_uInt16 nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
@@ -366,7 +366,7 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf
m_aStatusLB.SetHelpId(HID_MM_MAILSTATUS_TLB);
static long nTabs[] = {3, 0, nPos1, aSz.Width() };
- m_aStatusLB.SetWindowBits( WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
+ m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aStatusLB.SetSelectionMode( SINGLE_SELECTION );
m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aStatusLB.SetSpaceBetweenEntries(3);
@@ -692,7 +692,7 @@ void SwSendMailDialog::UpdateTransferStatus()
m_aErrorStatusFT.SetText(sStatus);
if(m_pImpl->aDescriptors.size())
- m_aProgressBar.SetValue((USHORT)(m_nSendCount * 100 / m_pImpl->aDescriptors.size()));
+ m_aProgressBar.SetValue((sal_uInt16)(m_nSendCount * 100 / m_pImpl->aDescriptors.size()));
else
m_aProgressBar.SetValue(0);
}
diff --git a/sw/source/ui/dbui/mailmergechildwindow.src b/sw/source/ui/dbui/mailmergechildwindow.src
index bdbf4e4917..0ca098fad1 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.src
+++ b/sw/source/ui/dbui/mailmergechildwindow.src
@@ -244,6 +244,7 @@ ModalDialog DLG_MM_SENDWARNING
};
MultiLineEdit ED_DETAILS
{
+ HelpID = "sw:MultiLineEdit:DLG_MM_SENDWARNING:ED_DETAILS";
Pos = MAP_APPFONT ( 40 , 50 ) ;
Size = MAP_APPFONT ( 194 , 50 ) ;
Border = TRUE;
diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx
index f267396f87..b2b75f3331 100644
--- a/sw/source/ui/dbui/mailmergehelper.cxx
+++ b/sw/source/ui/dbui/mailmergehelper.cxx
@@ -247,7 +247,7 @@ void SwAddressPreview::SetAddress(const ::rtl::OUString& rAddress)
{
pImpl->aAdresses.clear();
pImpl->aAdresses.push_back(rAddress);
- aVScrollBar.Show(FALSE);
+ aVScrollBar.Show(sal_False);
Invalidate();
}
@@ -389,7 +389,7 @@ void SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt )
void SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
{
- USHORT nKey = rKEvt.GetKeyCode().GetCode();
+ sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
if(pImpl->nRows || pImpl->nColumns)
{
sal_uInt32 nSelectedRow = (pImpl->nSelectedAddress + 1)/ pImpl->nColumns;
@@ -502,7 +502,7 @@ String SwAddressPreview::FillData(
//find the appropriate assignment
String sConvertedColumn = aItem.sText;
- for(USHORT nColumn = 0;
+ for(sal_uInt16 nColumn = 0;
nColumn < rDefHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
@@ -717,7 +717,7 @@ uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*
else
{
Sequence<sal_Int8> aData;
- SfxMedium aMedium( m_aURL, STREAM_STD_READ, FALSE );
+ SfxMedium aMedium( m_aURL, STREAM_STD_READ, sal_False );
SvStream* pStream = aMedium.GetInStream();
if ( aMedium.GetErrorCode() == ERRCODE_NONE && pStream)
{
diff --git a/sw/source/ui/dbui/mailmergewizard.src b/sw/source/ui/dbui/mailmergewizard.src
index ad7d574800..2756f5ff7a 100644
--- a/sw/source/ui/dbui/mailmergewizard.src
+++ b/sw/source/ui/dbui/mailmergewizard.src
@@ -30,6 +30,7 @@
ModalDialog DLG_MAILMERGEWIZARD
{
+ HelpID = "sw:ModalDialog:DLG_MAILMERGEWIZARD";
OutputSize = TRUE ;
SVLook = TRUE ;
Text [ en-US ] = "Mail Merge Wizard" ;
diff --git a/sw/source/ui/dbui/makefile.mk b/sw/source/ui/dbui/makefile.mk
deleted file mode 100644
index f125f07851..0000000000
--- a/sw/source/ui/dbui/makefile.mk
+++ /dev/null
@@ -1,108 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# 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.
-#
-# 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).
-#
-# 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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=sw
-TARGET=dbui
-LIBTARGET=no
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : $(PRJ)$/inc$/swpre.mk
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/inc$/sw.mk
-
-# --- Files --------------------------------------------------------
-IMGLST_SRS=$(SRS)$/dbui.srs
-BMP_IN=$(PRJ)$/win/imglst
-
-
-SRS1NAME=$(TARGET)
-SRC1FILES = \
- addresslistdialog.src \
- createaddresslistdialog.src \
- customizeaddresslistdialog.src \
- dbinsdlg.src \
- dbui.src \
- dbtablepreviewdialog.src \
- mailmergechildwindow.src \
- mailmergewizard.src \
- mmdocselectpage.src \
- mmlayoutpage.src \
- mmoutputpage.src \
- mmoutputtypepage.src \
- mmaddressblockpage.src \
- mmgreetingspage.src \
- mmmergepage.src \
- mmpreparemergepage.src \
- selectdbtabledialog.src \
-
-EXCEPTIONSFILES= \
- $(SLO)$/addresslistdialog.obj \
- $(SLO)$/createaddresslistdialog.obj \
- $(SLO)$/customizeaddresslistdialog.obj \
- $(SLO)$/dbinsdlg.obj \
- $(SLO)$/dbmgr.obj \
- $(SLO)$/dbtablepreviewdialog.obj \
- $(SLO)$/dbtree.obj \
- $(SLO)$/dbui.obj \
- $(SLO)$/maildispatcher.obj \
- $(SLO)$/mailmergechildwindow.obj \
- $(SLO)$/mailmergehelper.obj \
- $(SLO)$/mailmergewizard.obj \
- $(SLO)$/mmaddressblockpage.obj \
- $(SLO)$/mmconfigitem.obj \
- $(SLO)$/mmdocselectpage.obj \
- $(SLO)$/mmgreetingspage.obj \
- $(SLO)$/mmlayoutpage.obj \
- $(SLO)$/mmmergepage.obj \
- $(SLO)$/mmoutputpage.obj \
- $(SLO)$/mmoutputtypepage.obj \
- $(SLO)$/mmpreparemergepage.obj \
- $(SLO)$/selectdbtabledialog.obj
-
-SLOFILES = \
- $(EXCEPTIONSFILES) \
- $(SLO)$/swdbtoolsclient.obj
-
-
-LIB1TARGET = $(SLB)$/$(TARGET).lib
-
-LIB1OBJFILES = \
- $(SLO)$/dbmgr.obj \
- $(SLO)$/dbtree.obj \
- $(SLO)$/dbui.obj \
- $(SLO)$/maildispatcher.obj \
- $(SLO)$/mailmergehelper.obj \
- $(SLO)$/mailmergechildwindow.obj \
- $(SLO)$/mmconfigitem.obj \
- $(SLO)$/swdbtoolsclient.obj
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index ec237cb6ac..c651d291e8 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -296,16 +296,16 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton
}
else
{
- BOOL bNext = pButton == &m_aNextSetIB;
+ sal_Bool bNext = pButton == &m_aNextSetIB;
sal_Int32 nPos = rConfig.GetResultSetPosition();
rConfig.MoveResultSet( bNext ? ++nPos : --nPos);
}
m_pWizard->LeaveWait();
sal_Int32 nPos = rConfig.GetResultSetPosition();
- BOOL bEnable = TRUE;
+ sal_Bool bEnable = sal_True;
if(nPos < 1)
{
- bEnable = FALSE;
+ bEnable = sal_False;
nPos = 1;
}
else
@@ -507,12 +507,12 @@ SwRestrictedComboBox::~SwRestrictedComboBox()
void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt)
{
- BOOL bCallParent = TRUE;
+ sal_Bool bCallParent = sal_True;
if(rEvt.GetCharCode())
{
String sKey = rEvt.GetCharCode();
if( STRING_NOTFOUND != sForbiddenChars.Search(sKey))
- bCallParent = FALSE;
+ bCallParent = sal_False;
}
if(bCallParent)
ComboBox::KeyInput(rEvt);
@@ -522,11 +522,11 @@ void SwRestrictedComboBox::Modify()
{
Selection aSel = GetSelection();
String sTemp = GetText();
- for(USHORT i = 0; i < sForbiddenChars.Len(); i++)
+ for(sal_uInt16 i = 0; i < sForbiddenChars.Len(); i++)
{
sTemp.EraseAllChars( sForbiddenChars.GetChar(i) );
}
- USHORT nDiff = GetText().Len() - sTemp.Len();
+ sal_uInt16 nDiff = GetText().Len() - sTemp.Len();
if(nDiff)
{
aSel.setMin(aSel.getMin() - nDiff);
@@ -617,7 +617,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
}
FreeResource();
const ResStringArray& rHeaders = m_rConfigItem.GetDefaultAddressHeaders();
- for(USHORT i = 0; i < rHeaders.Count(); ++i)
+ for(sal_uInt16 i = 0; i < rHeaders.Count(); ++i)
{
const XubString& rHeader = rHeaders.GetString( i );
SvLBoxEntry* pEntry = m_aAddressElementsLB.InsertEntry(rHeader);
@@ -705,7 +705,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl()
sal_Int32 nRet = USER_DATA_NONE;
String sSelected = m_aDragED.GetCurrentItem();
if(sSelected.Len())
- for(ULONG i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
+ for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
{
SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i);
String sEntry = m_aAddressElementsLB.GetEntryText(pEntry);
@@ -722,7 +722,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData)
{
//get the entry from the ListBox
String sEntry;
- for(ULONG i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
+ for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
{
SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i);
if((sal_Int32)(sal_IntPtr)pEntry->GetUserData() == nUserData)
@@ -841,7 +841,7 @@ void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress)
//remove placeholders by the actual content
if(m_aFieldFT.IsVisible())
{
- for(ULONG i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
+ for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i)
{
SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i);
String sEntry = m_aAddressElementsLB.GetEntryText(pEntry);
@@ -1010,8 +1010,27 @@ SwAssignFieldsControl::SwAssignFieldsControl(
uno::Sequence< ::rtl::OUString> aAssignments = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() );
Link aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl);
Link aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl);
+
+ static const char* aHIDs[] =
+ {
+ HID_MM_HEADER_0,
+ HID_MM_HEADER_1,
+ HID_MM_HEADER_2,
+ HID_MM_HEADER_3,
+ HID_MM_HEADER_4,
+ HID_MM_HEADER_5,
+ HID_MM_HEADER_6,
+ HID_MM_HEADER_7,
+ HID_MM_HEADER_8,
+ HID_MM_HEADER_9,
+ HID_MM_HEADER_10,
+ HID_MM_HEADER_11,
+ HID_MM_HEADER_12,
+ HID_MM_HEADER_13
+ };
+
//fill the controls
- for(USHORT i = 0; i < rHeaders.Count(); ++i)
+ for(sal_uInt16 i = 0; i < rHeaders.Count(); ++i)
{
const XubString& rHeader = rHeaders.GetString( i );
FixedInfo* pNewText = new FixedInfo(&m_aWindow, ResId( FT_FIELDS, *rResId.GetResMgr()));
@@ -1019,7 +1038,7 @@ SwAssignFieldsControl::SwAssignFieldsControl(
sLabel.Insert(rHeader, 1);
pNewText->SetText(sLabel);
ListBox* pNewLB = new ListBox(&m_aWindow, ResId(LB_FIELDS, *rResId.GetResMgr()));
- pNewLB->SetHelpId( HID_MM_HEADER_0 + i );
+ pNewLB->SetHelpId( aHIDs[i] );
pNewLB->SelectEntryPos(0);
for(sal_Int32 nField = 0; nField < aFields.getLength(); ++nField)
pNewLB->InsertEntry(pFields[nField]);
@@ -1115,7 +1134,7 @@ long SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt )
if(rNEvt.GetType() == EVENT_COMMAND)
{
const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
- USHORT nCmd = pCEvt->GetCommand();
+ sal_uInt16 nCmd = pCEvt->GetCommand();
if( COMMAND_WHEEL == nCmd )
{
Command(*pCEvt);
@@ -1147,7 +1166,7 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
// The first line has to be -(nThumb * m_nYOffset) in the negative
long nMove = m_nFirstYPos - (*m_aMatches.begin())->GetPosPixel().Y() - (nThumb * m_nYOffset);
- SetUpdateMode(FALSE);
+ SetUpdateMode(sal_False);
long nIndex;
::std::vector<FixedInfo*>::iterator aFIIter;
for(nIndex = 0, aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter, ++nIndex)
@@ -1157,7 +1176,7 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll)
lcl_Move(*aLBIter, nMove);
for(nIndex = 0, aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter, ++nIndex)
lcl_Move(*aFIIter, nMove);
- SetUpdateMode(TRUE);
+ SetUpdateMode(sal_True);
return 0;
}
@@ -1315,11 +1334,11 @@ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId)
SvTreeListBox(pParent, rResId),
m_pParentDialog(pParent)
{
- SetWindowBits( /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
+ SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
WB_CLIPCHILDREN );
SetSelectionMode( SINGLE_SELECTION );
SetDragDropMode( SV_DRAGDROP_CTRL_COPY );
- EnableAsyncDrag(TRUE);
+ EnableAsyncDrag(sal_True);
SetHelpId(HID_MM_CUSTOMFIELDS);
// expand selection to the complete width of the ListBox
SetHighlightRange();
@@ -1366,7 +1385,7 @@ AddressMultiLineEdit::AddressMultiLineEdit(SwCustomizeAddressBlockDialog* pParen
{
GetTextView()->SupportProtectAttribute(sal_True);
StartListening(*GetTextEngine());
- EnableFocusSelectionHide(FALSE);
+ EnableFocusSelectionHide(sal_False);
}
AddressMultiLineEdit::~AddressMultiLineEdit()
@@ -1416,8 +1435,8 @@ void AddressMultiLineEdit::SetText( const String& rStr )
ExtTextEngine* pTextEngine = GetTextEngine();
TextAttribProtect aProtectAttr;
- ULONG nParaCount = pTextEngine->GetParagraphCount();
- for(ULONG nPara = 0; nPara < nParaCount; ++nPara)
+ sal_uLong nParaCount = pTextEngine->GetParagraphCount();
+ for(sal_uLong nPara = 0; nPara < nParaCount; ++nPara)
{
xub_StrLen nIndex = 0;
String sPara = pTextEngine->GetText( nPara );
@@ -1428,11 +1447,11 @@ void AddressMultiLineEdit::SetText( const String& rStr )
}
while(true)
{
- USHORT nStart = sPara.Search( '<', nIndex );
- USHORT nEnd = sPara.Search( '>', nStart );
+ sal_uInt16 nStart = sPara.Search( '<', nIndex );
+ sal_uInt16 nEnd = sPara.Search( '>', nStart );
nIndex = nEnd;
if(nStart != STRING_NOTFOUND && nEnd != STRING_NOTFOUND)
- pTextEngine->SetAttrib( aProtectAttr, nPara, nStart, nEnd + 1, FALSE );
+ pTextEngine->SetAttrib( aProtectAttr, nPara, nStart, nEnd + 1, sal_False );
else
break;
}
@@ -1458,8 +1477,8 @@ void AddressMultiLineEdit::InsertNewEntry( const String& rStr )
// insert new entry after current selected one.
ExtTextView* pTextView = GetTextView();
const TextSelection& rSelection = pTextView->GetSelection();
- ULONG nPara = rSelection.GetStart().GetPara();
- USHORT nIndex = rSelection.GetEnd().GetIndex();
+ sal_uLong nPara = rSelection.GetStart().GetPara();
+ sal_uInt16 nIndex = rSelection.GetEnd().GetIndex();
ExtTextEngine *pTextEngine = GetTextEngine();
const TextCharAttrib *pAttrib;
if(0 != (pAttrib = pTextEngine->FindCharAttrib( rSelection.GetStart(), TEXTATTR_PROTECTED )))
@@ -1474,7 +1493,7 @@ void AddressMultiLineEdit::InsertNewEntry( const String& rStr )
Modify();
}
-void AddressMultiLineEdit::InsertNewEntryAtPosition( const String& rStr, ULONG nPara, USHORT nIndex )
+void AddressMultiLineEdit::InsertNewEntryAtPosition( const String& rStr, sal_uLong nPara, sal_uInt16 nIndex )
{
ExtTextEngine* pTextEngine = GetTextEngine();
TextPaM aInsertPos( nPara, nIndex );
@@ -1500,7 +1519,7 @@ void AddressMultiLineEdit::RemoveCurrentEntry()
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
{
- ULONG nPara = rSelection.GetStart().GetPara();
+ sal_uLong nPara = rSelection.GetStart().GetPara();
TextSelection aEntrySel(TextPaM( nPara, pBeginAttrib->GetStart()), TextPaM(nPara, pBeginAttrib->GetEnd()));
pTextEngine->ReplaceText(aEntrySel, String());
//restore the attributes
@@ -1520,8 +1539,8 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
{
//current item has been found
- ULONG nPara = rSelection.GetStart().GetPara();
- USHORT nIndex = pBeginAttrib->GetStart();
+ sal_uLong nPara = rSelection.GetStart().GetPara();
+ sal_uInt16 nIndex = pBeginAttrib->GetStart();
TextSelection aEntrySel(TextPaM( nPara, pBeginAttrib->GetStart()), TextPaM(nPara, pBeginAttrib->GetEnd()));
String sCurrentItem = pTextEngine->GetText(aEntrySel);
pTextEngine->RemoveAttrib( nPara, *pBeginAttrib );
@@ -1625,7 +1644,7 @@ String AddressMultiLineEdit::GetCurrentItem()
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
{
- ULONG nPara = rSelection.GetStart().GetPara();
+ sal_uLong nPara = rSelection.GetStart().GetPara();
TextSelection aEntrySel(TextPaM( nPara, pBeginAttrib->GetStart()), TextPaM(nPara, pBeginAttrib->GetEnd()));
sRet = pTextEngine->GetText( aEntrySel );
}
@@ -1642,7 +1661,7 @@ void AddressMultiLineEdit::SelectCurrentItem()
(pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
{
- ULONG nPara = rSelection.GetStart().GetPara();
+ sal_uLong nPara = rSelection.GetStart().GetPara();
TextSelection aEntrySel(TextPaM( nPara, pBeginAttrib->GetStart()), TextPaM(nPara, pBeginAttrib->GetEnd()));
pTextView->SetSelection(aEntrySel);
Invalidate();
@@ -1653,8 +1672,8 @@ String AddressMultiLineEdit::GetAddress()
{
String sRet;
ExtTextEngine* pTextEngine = GetTextEngine();
- ULONG nParaCount = pTextEngine->GetParagraphCount();
- for(ULONG nPara = nParaCount; nPara; --nPara)
+ sal_uLong nParaCount = pTextEngine->GetParagraphCount();
+ for(sal_uLong nPara = nParaCount; nPara; --nPara)
{
String sPara = pTextEngine->GetText( nPara - 1);
sPara.EraseTrailingChars(' ');
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index b6c0d0d8cd..e4a2f2fe31 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -186,7 +186,7 @@ public:
String GetAddress();
void InsertNewEntry( const String& rStr );
- void InsertNewEntryAtPosition( const String& rStr, ULONG nPara, USHORT nIndex );
+ void InsertNewEntryAtPosition( const String& rStr, sal_uLong nPara, sal_uInt16 nIndex );
void RemoveCurrentEntry();
void MoveCurrentItem(sal_uInt16 nMove);
diff --git a/sw/source/ui/dbui/mmaddressblockpage.src b/sw/source/ui/dbui/mmaddressblockpage.src
index 9058cfb7ee..3f8756f03c 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.src
+++ b/sw/source/ui/dbui/mmaddressblockpage.src
@@ -63,6 +63,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
PushButton PB_ADDRESSLIST
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_ADDRESSLIST";
Pos = MAP_APPFONT ( 154 , 27 ) ;
Size = MAP_APPFONT ( 100 , 14 ) ;
Text[ en-US ] = "Select A~ddress List...";
@@ -91,6 +92,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
CheckBox CB_ADDRESS
{
+ HelpID = "sw:CheckBox:DLG_MM_ADDRESSBLOCK_PAGE:CB_ADDRESS";
Pos = MAP_APPFONT ( 16 , 66 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text[ en-US ] = "~This document shall contain an address block";
@@ -103,6 +105,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
PushButton PB_SETTINGS
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_SETTINGS";
Pos = MAP_APPFONT ( 194 , 110 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Group = FALSE;
@@ -110,6 +113,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
CheckBox CB_HIDE_EMPTY_PARA
{
+ HelpID = "sw:CheckBox:DLG_MM_ADDRESSBLOCK_PAGE:CB_HIDE_EMPTY_PARA";
Pos = MAP_APPFONT ( 24 , 127 ) ;
Size = MAP_APPFONT ( 230 , 10 ) ;
Text[ en-US ] = "~Suppress lines with just empty fields";
@@ -134,6 +138,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
PushButton PB_ASSIGN
{
+ HelpID = "sw:PushButton:DLG_MM_ADDRESSBLOCK_PAGE:PB_ASSIGN";
Pos = MAP_APPFONT ( 194 , 151 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text[ en-US ] = "Match ~Fields...";
@@ -169,6 +174,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
ImageButton IB_PREVSET
{
+ HelpID = "sw:ImageButton:DLG_MM_ADDRESSBLOCK_PAGE:IB_PREVSET";
Pos = MAP_APPFONT ( 167 , 238 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
SYMBOL = IMAGEBUTTON_PREV;
@@ -176,6 +182,7 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE
};
ImageButton IB_NEXTSET
{
+ HelpID = "sw:ImageButton:DLG_MM_ADDRESSBLOCK_PAGE:IB_NEXTSET";
Pos = MAP_APPFONT ( 178 , 238 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
SYMBOL = IMAGEBUTTON_NEXT ;
@@ -212,18 +219,21 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK
};
PushButton PB_NEW
{
+ HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_NEW";
Pos = MAP_APPFONT ( 204 , 14 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~New...";
};
PushButton PB_CUSTOMIZE
{
+ HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_CUSTOMIZE";
Pos = MAP_APPFONT ( 204 , 31 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Edit...";
};
PushButton PB_DELETE
{
+ HelpID = "sw:PushButton:DLG_MM_SELECTADDRESSBLOCK:PB_DELETE";
Pos = MAP_APPFONT ( 204 , 48 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Group = FALSE;
@@ -238,24 +248,28 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK
};
RadioButton RB_NEVER
{
+ HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_NEVER";
Pos = MAP_APPFONT ( 12 , 131 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "N~ever include the country/region";
};
RadioButton RB_ALWAYS
{
+ HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_ALWAYS";
Pos = MAP_APPFONT ( 12 , 145 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Always include the country/region";
};
RadioButton RB_DEPENDENT
{
+ HelpID = "sw:RadioButton:DLG_MM_SELECTADDRESSBLOCK:RB_DEPENDENT";
Pos = MAP_APPFONT ( 12 , 159 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "Only ~include the country/region if it is not:";
};
Edit ED_COUNTRY
{
+ HelpID = "sw:Edit:DLG_MM_SELECTADDRESSBLOCK:ED_COUNTRY";
Pos = MAP_APPFONT ( 18 , 172 ) ;
Size = MAP_APPFONT ( 180 , 12 ) ;
Border = TRUE;
@@ -330,6 +344,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ImageButton IB_INSERTFIELD
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_INSERTFIELD";
Pos = MAP_APPFONT ( 80 , 29 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_RIGHT;
@@ -341,6 +356,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ImageButton IB_REMOVEFIELD
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_REMOVEFIELD";
Pos = MAP_APPFONT ( 80 , 46 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_LEFT;
@@ -362,12 +378,14 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
MultiLineEdit ED_DRAG
{
+ HelpID = "sw:MultiLineEdit:DLG_MM_CUSTOMIZEADDRESSBLOCK:ED_DRAG";
Pos = MAP_APPFONT ( 106 , 14 ) ;
Size = MAP_APPFONT ( 160 , 60 ) ;
Border = TRUE;
};
ImageButton IB_UP
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_UP";
Pos = MAP_APPFONT ( 285 , 14 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_UP;
@@ -375,6 +393,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ImageButton IB_LEFT
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_LEFT";
Pos = MAP_APPFONT ( 270 , 29 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_LEFT;
@@ -382,6 +401,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ImageButton IB_RIGHT
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_RIGHT";
Pos = MAP_APPFONT ( 300 , 29 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_RIGHT;
@@ -389,6 +409,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ImageButton IB_DOWN
{
+ HelpID = "sw:ImageButton:DLG_MM_CUSTOMIZEADDRESSBLOCK:IB_DOWN";
Pos = MAP_APPFONT ( 285 , 48 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Symbol = IMAGEBUTTON_ARROW_DOWN;
@@ -403,6 +424,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK
};
ComboBox CB_FIELD
{
+ HelpID = "sw:ComboBox:DLG_MM_CUSTOMIZEADDRESSBLOCK:CB_FIELD";
Pos = MAP_APPFONT ( 106 , 89 ) ;
Size = MAP_APPFONT ( 160 , 50 ) ;
Border = TRUE;
@@ -551,6 +573,7 @@ ModalDialog DLG_MM_ASSIGNFIELDS
};
ListBox LB_FIELDS
{
+ HelpID = "sw:ListBox:DLG_MM_ASSIGNFIELDS:LB_FIELDS";
Pos = MAP_APPFONT ( 83 , 4 ) ;
Size = MAP_APPFONT ( 74 , 50 ) ;
TabStop = TRUE;
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index 7deaefb2db..9dd2379093 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -408,7 +408,7 @@ void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders )
//convert the strings used for UI to numbers used for the configuration
String sBlock(rBlock);
sBlock.SearchAndReplaceAllAscii("\n", String::CreateFromAscii("\\n"));
- for(USHORT i = 0; i < rHeaders.Count(); ++i)
+ for(sal_uInt16 i = 0; i < rHeaders.Count(); ++i)
{
String sHeader = rHeaders.GetString( i );
sHeader.Insert('<', 0);
@@ -997,7 +997,7 @@ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget)
{
if(nTarget > 0)
{
- BOOL bMoved = m_pImpl->xResultSet->absolute(nTarget);
+ sal_Bool bMoved = m_pImpl->xResultSet->absolute(nTarget);
if(!bMoved)
{
if(nTarget > 1)
@@ -1326,7 +1326,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const
if(aItem.bIsColumn)
{
String sConvertedColumn = aItem.sText;
- for(USHORT nColumn = 0;
+ for(sal_uInt16 nColumn = 0;
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
@@ -1385,7 +1385,7 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
if(aItem.bIsColumn)
{
String sConvertedColumn = aItem.sText;
- for(USHORT nColumn = 0;
+ for(sal_uInt16 nColumn = 0;
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
@@ -1666,13 +1666,13 @@ sal_uInt32 SwMailMergeConfigItem::GetMergedDocumentCount() const
SwView* lcl_ExistsView(SwView* pView)
{
const TypeId aType(TYPE(SwView));
- SfxViewShell* pViewShell = SfxViewShell::GetFirst( &aType, FALSE );
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst( &aType, sal_False );
while(pViewShell)
{
if(pViewShell == pView)
return pView;
- pViewShell = SfxViewShell::GetNext( *pViewShell, &aType, FALSE );
+ pViewShell = SfxViewShell::GetNext( *pViewShell, &aType, sal_False );
}
return 0;
}
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 232dbed83e..10fb6251ba 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -132,7 +132,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
{
m_aLoadTemplateRB.Check();
SfxNewFileDialog* pNewFileDlg = new SfxNewFileDialog(this, 0);
- USHORT nRet = pNewFileDlg->Execute();
+ sal_uInt16 nRet = pNewFileDlg->Execute();
if(RET_TEMPLATE_LOAD == nRet)
bTemplate = false;
else if(RET_CANCEL != nRet)
diff --git a/sw/source/ui/dbui/mmdocselectpage.src b/sw/source/ui/dbui/mmdocselectpage.src
index ace679af4f..9f6c1df5df 100644
--- a/sw/source/ui/dbui/mmdocselectpage.src
+++ b/sw/source/ui/dbui/mmdocselectpage.src
@@ -47,48 +47,56 @@ TabPage DLG_MM_DOCSELECT_PAGE
};
RadioButton RB_CURRENTDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_CURRENTDOC";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 190 , 10 ) ;
Text[ en-US ] = "Use the current ~document";
};
RadioButton RB_NEWDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_NEWDOC";
Pos = MAP_APPFONT ( 12 , 66 ) ;
Size = MAP_APPFONT ( 190 , 10 ) ;
Text[ en-US ] = "Create a ne~w document";
};
RadioButton RB_LOADDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADDOC";
Pos = MAP_APPFONT ( 12 , 84) ;
Size = MAP_APPFONT ( 190 , 10 ) ;
Text[ en-US ] = "Start from ~existing document";
};
PushButton PB_LOADDOC
{
+ HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_LOADDOC";
Pos = MAP_APPFONT ( 204 , 80) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "B~rowse...";
};
RadioButton RB_LOADTEMPLATE
{
+ HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_LOADTEMPLATE";
Pos = MAP_APPFONT ( 12 , 103 ) ;
Size = MAP_APPFONT ( 190 , 10 ) ;
Text[ en-US ] = "Start from a t~emplate";
};
PushButton PB_BROWSETEMPLATE
{
+ HelpID = "sw:PushButton:DLG_MM_DOCSELECT_PAGE:PB_BROWSETEMPLATE";
Pos = MAP_APPFONT ( 204 , 99 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "B~rowse...";
};
RadioButton RB_RECENTDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_DOCSELECT_PAGE:RB_RECENTDOC";
Pos = MAP_APPFONT ( 12 , 120) ;
Size = MAP_APPFONT ( 190 , 10 ) ;
Text[ en-US ] = "Start fro~m a recently saved starting document";
};
ListBox LB_RECENTDOC
{
+ HelpID = "sw:ListBox:DLG_MM_DOCSELECT_PAGE:LB_RECENTDOC";
Pos = MAP_APPFONT ( 20 , 134 ) ;
Size = MAP_APPFONT ( 180 , 50 ) ;
DropDown = TRUE;
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index c8cd2d8cd7..b9803d0615 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -56,7 +56,7 @@ void lcl_FillGreetingsBox(ListBox& rBox,
const Sequence< ::rtl::OUString> rEntries = rConfig.GetGreetings(eType);
for(sal_Int32 nEntry = 0; nEntry < rEntries.getLength(); ++nEntry)
rBox.InsertEntry(rEntries[nEntry]);
- rBox.SelectEntryPos((USHORT)rConfig.GetCurrentGreeting(eType));
+ rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType));
}
void lcl_FillGreetingsBox(ComboBox& rBox,
@@ -66,7 +66,7 @@ void lcl_FillGreetingsBox(ComboBox& rBox,
const Sequence< ::rtl::OUString> rEntries = rConfig.GetGreetings(eType);
for(sal_Int32 nEntry = 0; nEntry < rEntries.getLength(); ++nEntry)
rBox.InsertEntry(rEntries[nEntry]);
- rBox.SelectEntryPos((USHORT)rConfig.GetCurrentGreeting(eType));
+ rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType));
}
void lcl_StoreGreetingsBox(ListBox& rBox,
@@ -75,7 +75,7 @@ void lcl_StoreGreetingsBox(ListBox& rBox,
{
Sequence< ::rtl::OUString> aEntries(rBox.GetEntryCount());
::rtl::OUString* pEntries = aEntries.getArray();
- for(USHORT nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry)
+ for(sal_uInt16 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry)
pEntries[nEntry] = rBox.GetEntry(nEntry);
rConfig.SetGreetings(eType, aEntries);
rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos());
@@ -87,7 +87,7 @@ void lcl_StoreGreetingsBox(ComboBox& rBox,
{
Sequence< ::rtl::OUString> aEntries(rBox.GetEntryCount());
::rtl::OUString* pEntries = aEntries.getArray();
- for(USHORT nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry)
+ for(sal_uInt16 nEntry = 0; nEntry < rBox.GetEntryCount(); ++nEntry)
pEntries[nEntry] = rBox.GetEntry(nEntry);
rConfig.SetGreetings(eType, aEntries);
rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos());
@@ -95,7 +95,7 @@ void lcl_StoreGreetingsBox(ComboBox& rBox,
IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG)
{
- BOOL bIndividual = m_pPersonalizedCB->IsEnabled() && m_pPersonalizedCB->IsChecked();
+ sal_Bool bIndividual = m_pPersonalizedCB->IsEnabled() && m_pPersonalizedCB->IsChecked();
m_pFemaleFT->Enable(bIndividual);
m_pFemaleLB->Enable(bIndividual);
m_pFemalePB->Enable(bIndividual);
@@ -388,10 +388,10 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPage
lcl_StoreGreetingsBox(m_aFemaleLB, rConfig, SwMailMergeConfigItem::FEMALE);
lcl_StoreGreetingsBox(m_aMaleLB, rConfig, SwMailMergeConfigItem::MALE);
- USHORT nCurrentTextPos = m_aNeutralCB.GetEntryPos( m_aNeutralCB.GetText() );
+ sal_uInt16 nCurrentTextPos = m_aNeutralCB.GetEntryPos( m_aNeutralCB.GetText() );
if(LISTBOX_ENTRY_NOTFOUND == nCurrentTextPos)
{
- USHORT nCount = m_aNeutralCB.GetEntryCount();
+ sal_uInt16 nCount = m_aNeutralCB.GetEntryCount();
m_aNeutralCB.InsertEntry( m_aNeutralCB.GetText(), nCount );
m_aNeutralCB.SelectEntryPos(nCount);
}
@@ -427,15 +427,15 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton)
}
else
{
- BOOL bNext = pButton == &m_aNextSetIB;
+ sal_Bool bNext = pButton == &m_aNextSetIB;
sal_Int32 nPos = rConfig.GetResultSetPosition();
rConfig.MoveResultSet( bNext ? ++nPos : --nPos);
}
sal_Int32 nPos = rConfig.GetResultSetPosition();
- BOOL bEnable = TRUE;
+ sal_Bool bEnable = sal_True;
if(nPos < 1)
{
- bEnable = FALSE;
+ bEnable = sal_False;
nPos = 1;
}
else
diff --git a/sw/source/ui/dbui/mmgreetingspage.src b/sw/source/ui/dbui/mmgreetingspage.src
index fff77d9240..5cae953a35 100644
--- a/sw/source/ui/dbui/mmgreetingspage.src
+++ b/sw/source/ui/dbui/mmgreetingspage.src
@@ -144,6 +144,7 @@ TabPage DLG_MM_GREETINGS_PAGE
};
CheckBox CB_GREETINGLINE
{
+ HelpID = "sw:CheckBox:DLG_MM_GREETINGS_PAGE:CB_GREETINGLINE";
Pos = MAP_APPFONT ( 12 , 27 );
Size = MAP_APPFONT ( 242 , 10 );
Text[ en-US ] = "This document should contain a salutation";
@@ -163,6 +164,7 @@ TabPage DLG_MM_GREETINGS_PAGE
};
PushButton PB_ASSIGN
{
+ HelpID = "sw:PushButton:DLG_MM_GREETINGS_PAGE:PB_ASSIGN";
Pos = MAP_APPFONT ( 204 , 179 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Match fields...";
@@ -175,6 +177,7 @@ TabPage DLG_MM_GREETINGS_PAGE
};
ImageButton IB_PREVSET
{
+ HelpID = "sw:ImageButton:DLG_MM_GREETINGS_PAGE:IB_PREVSET";
Pos = MAP_APPFONT ( 177 , 204 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
SYMBOL = IMAGEBUTTON_PREV;
@@ -182,6 +185,7 @@ TabPage DLG_MM_GREETINGS_PAGE
};
ImageButton IB_NEXTSET
{
+ HelpID = "sw:ImageButton:DLG_MM_GREETINGS_PAGE:IB_NEXTSET";
Pos = MAP_APPFONT ( 188 , 204 ) ;
Size = MAP_APPFONT ( 10 , 10 ) ;
SYMBOL = IMAGEBUTTON_NEXT ;
@@ -208,6 +212,7 @@ ModalDialog DLG_MM_MAILBODY
Text [ en-US ] = "E-Mail Message";
CheckBox CB_GREETINGLINE
{
+ HelpID = "sw:CheckBox:DLG_MM_MAILBODY:CB_GREETINGLINE";
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 242 , 10 ) ;
Text[ en-US ] = "This e-mail should contain a salutation";
@@ -221,6 +226,7 @@ ModalDialog DLG_MM_MAILBODY
};
MultiLineEdit MLE_BODY
{
+ HelpID = "sw:MultiLineEdit:DLG_MM_MAILBODY:MLE_BODY";
Pos = MAP_APPFONT ( 12, 151 ) ;
Size = MAP_APPFONT ( 180 , 50 ) ;
Border = TRUE;
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index eaa6dbe660..2e772aea98 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -147,8 +147,8 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
m_pExampleFrame = new SwOneExampleFrame( m_aExampleWIN,
EX_SHOW_DEFAULT_PAGE, &aLink, &m_sExampleURL );
- m_aExampleWIN.Show( FALSE );
- m_aExampleContainerWIN.Show(TRUE);
+ m_aExampleWIN.Show( sal_False );
+ m_aExampleContainerWIN.Show(sal_True);
m_aLeftMF.SetValue(m_aLeftMF.Normalize(DEFAULT_LEFT_DISTANCE), FUNIT_TWIP);
m_aTopMF.SetValue(m_aTopMF.Normalize(DEFAULT_TOP_DISTANCE), FUNIT_TWIP);
@@ -230,7 +230,7 @@ void SwMailMergeLayoutPage::ActivatePage()
m_pExampleWrtShell->GotoFly( m_pAddressBlockFormat->GetName() );
m_pExampleWrtShell->DelRight();
m_pAddressBlockFormat = 0;
- m_pExampleWrtShell->Pop(FALSE);
+ m_pExampleWrtShell->Pop(sal_False);
}
else
{
@@ -368,7 +368,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
if(aItem.bIsColumn)
{
String sConvertedColumn = aItem.sText;
- for(USHORT nColumn = 0;
+ for(sal_uInt16 nColumn = 0;
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
@@ -459,7 +459,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
{
//there's already text at the desired position
//go to start of the doc, directly!
- rShell.SttEndDoc(TRUE);
+ rShell.SttEndDoc(sal_True);
//and go by paragraph until the position is reached
long nYPos = rShell.GetCharRect().Top();
while(nYPos < GREETING_TOP_DISTANCE)
@@ -625,7 +625,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
{
String sDB(sDBName);
String sConvertedColumn = aItem.sText;
- for(USHORT nColumn = 0;
+ for(sal_uInt16 nColumn = 0;
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
@@ -666,7 +666,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
{
rShell.Push();
rShell.SplitNode();
- rShell.Pop(FALSE);
+ rShell.Pop(sal_False);
}
//put the cursor to the start of the paragraph
rShell.SttPara();
@@ -676,8 +676,8 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG)
{
- m_aExampleWIN.Show( TRUE );
- m_aExampleContainerWIN.Show(FALSE);
+ m_aExampleWIN.Show( sal_True );
+ m_aExampleContainerWIN.Show(sal_False);
Reference< XModel > & xModel = m_pExampleFrame->GetModel();
//now the ViewOptions should be set properly
@@ -763,7 +763,7 @@ IMPL_LINK(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, MetricField*, EMPTYARG)
IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton)
{
bool bDown = pButton == &m_aDownPB;
- BOOL bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 );
+ sal_Bool bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 );
if (bMoved || bDown)
m_pWizard->GetConfigItem().MoveGreeting(bDown ? 1 : -1 );
if(!bMoved && bDown)
diff --git a/sw/source/ui/dbui/mmlayoutpage.src b/sw/source/ui/dbui/mmlayoutpage.src
index 07582a45ef..94e1387306 100644
--- a/sw/source/ui/dbui/mmlayoutpage.src
+++ b/sw/source/ui/dbui/mmlayoutpage.src
@@ -48,6 +48,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
CheckBox CB_ALIGN
{
+ HelpID = "sw:CheckBox:DLG_MM_LAYOUT_PAGE:CB_ALIGN";
Pos = MAP_APPFONT ( 6 , 40 ) ;
Size = MAP_APPFONT ( 118 , 10 ) ;
Text[ en-US ] = "Align to text body";
@@ -60,6 +61,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
MetricField MF_LEFT
{
+ HelpID = "sw:MetricField:DLG_MM_LAYOUT_PAGE:MF_LEFT";
Pos = MAP_APPFONT ( 78 , 52 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Border = TRUE ;
@@ -83,6 +85,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
MetricField MF_TOP
{
+ HelpID = "sw:MetricField:DLG_MM_LAYOUT_PAGE:MF_TOP";
Pos = MAP_APPFONT ( 78 , 67 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
Border = TRUE ;
@@ -112,6 +115,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
PushButton MF_UP
{
+ HelpID = "sw:PushButton:DLG_MM_LAYOUT_PAGE:MF_UP";
Pos = MAP_APPFONT ( 68 , 96 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Up";
@@ -124,6 +128,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
PushButton PB_DOWN
{
+ HelpID = "sw:PushButton:DLG_MM_LAYOUT_PAGE:PB_DOWN";
Pos = MAP_APPFONT ( 68 , 113 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Down";
@@ -143,6 +148,7 @@ TabPage DLG_MM_LAYOUT_PAGE
};
ListBox LB_ZOOM
{
+ HelpID = "sw:ListBox:DLG_MM_LAYOUT_PAGE:LB_ZOOM";
Pos = MAP_APPFONT ( 204 , 182 ) ;
Size = MAP_APPFONT ( 50 , 50 ) ;
Border = TRUE;
diff --git a/sw/source/ui/dbui/mmmergepage.src b/sw/source/ui/dbui/mmmergepage.src
index fd9fffc0de..8480e97e0e 100644
--- a/sw/source/ui/dbui/mmmergepage.src
+++ b/sw/source/ui/dbui/mmmergepage.src
@@ -49,6 +49,7 @@ TabPage DLG_MM_MERGE_PAGE
};
PushButton PB_EDIT
{
+ HelpID = "sw:PushButton:DLG_MM_MERGE_PAGE:PB_EDIT";
Pos = MAP_APPFONT ( 70 , 67 ) ;
Size = MAP_APPFONT ( 120 , 14 ) ;
Text [ en-US ] = "~Edit individual document...";
@@ -67,30 +68,35 @@ TabPage DLG_MM_MERGE_PAGE
};
Edit ED_FIND
{
+ HelpID = "sw:Edit:DLG_MM_MERGE_PAGE:ED_FIND";
Pos = MAP_APPFONT ( 55 ,114 ) ;
Size = MAP_APPFONT ( 140 , 12 ) ;
Border = TRUE;
};
PushButton PB_FIND
{
+ HelpID = "sw:PushButton:DLG_MM_MERGE_PAGE:PB_FIND";
Pos = MAP_APPFONT ( 198 ,113 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Find...";
};
CheckBox CB_WHOLEWORDS
{
+ HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_WHOLEWORDS";
Pos = MAP_APPFONT ( 55 , 131 ) ;
Size = MAP_APPFONT ( 180 , 10 ) ;
Text [ en-US ] = "Whole wor~ds only";
};
CheckBox CB_BACKWARDS
{
+ HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_BACKWARDS";
Pos = MAP_APPFONT ( 55 , 144 ) ;
Size = MAP_APPFONT ( 180 , 10 ) ;
Text [ en-US ] = "Back~wards";
};
CheckBox CB_MATCHCASE
{
+ HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_MATCHCASE";
Pos = MAP_APPFONT ( 55 , 157 ) ;
Size = MAP_APPFONT ( 180 , 10 ) ;
Text [ en-US ] = "Ma~tch case";
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 4ed4fbf5e8..4189a4e467 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -84,7 +84,7 @@ using namespace svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-String lcl_GetExtensionForDocType(ULONG nDocType)
+String lcl_GetExtensionForDocType(sal_uLong nDocType)
{
String sExtension;
switch( nDocType )
@@ -447,7 +447,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
&m_aSendAllRB, &m_aSendDocumentsPB,
0
};
- SetUpdateMode(TRUE);
+ SetUpdateMode(sal_True);
Control** pControl = aControls;
do
{
@@ -543,7 +543,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
String sAttach( m_sDefaultAttachmentST );
sAttach += '.';
sAttach += lcl_GetExtensionForDocType(
- (ULONG)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos()));
+ (sal_uLong)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos()));
m_aAttachmentED.SetText( sAttach );
}
@@ -589,7 +589,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton)
}
m_aFromRB.GetClickHdl().Call(m_aFromRB.IsChecked() ? &m_aFromRB : 0);
- SetUpdateMode(FALSE);
+ SetUpdateMode(sal_False);
return 0;
}
@@ -647,9 +647,9 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton)
rConfigItem.AddSavedDocument(
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI));
- pButton->Enable(FALSE);
+ pButton->Enable(sal_False);
m_pWizard->enableButtons(WZB_FINISH, sal_True);
- pButton->Enable(FALSE);
+ pButton->Enable(sal_False);
}
}
@@ -782,7 +782,8 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
aSaveMonitor.aPrintInfo.SetText(sStat);
//now extract a document from the target document
- SfxObjectShellRef xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
+ // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
+ SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xTempDocShell->DoInitNew( 0 );
SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 );
SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() );
@@ -797,7 +798,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
sTargetTempURL, aOpt, sal_True );
pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(),
- (USHORT)rInfo.nStartPageInTarget, (USHORT)rInfo.nEndPageInTarget );
+ (sal_uInt16)rInfo.nStartPageInTarget, (sal_uInt16)rInfo.nEndPageInTarget );
pTargetView->GetWrtShell().EndAction();
//then save it
String sOutPath = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
@@ -907,7 +908,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG)
if(nEnd > rConfigItem.GetMergedDocumentCount())
nEnd = rConfigItem.GetMergedDocumentCount();
}
- rConfigItem.SetPrintRange( (USHORT)nBegin, (USHORT)nEnd );
+ rConfigItem.SetPrintRange( (sal_uInt16)nBegin, (sal_uInt16)nEnd );
SwDocMergeInfo& rStartInfo = rConfigItem.GetDocumentMergeInfo(nBegin);
SwDocMergeInfo& rEndInfo = rConfigItem.GetDocumentMergeInfo(nEnd - 1);
@@ -955,7 +956,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterSetupHdl_Impl, PushButton*, pButton)
IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
{
- ULONG nDocType = (ULONG)pBox->GetEntryData(pBox->GetSelectEntryPos());
+ sal_uLong nDocType = (sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos());
sal_Bool bEnable = MM_DOCTYPE_HTML != nDocType && MM_DOCTYPE_TEXT != nDocType;
m_aSendAsPB.Enable( bEnable );
m_aAttachmentFT.Enable( bEnable );
@@ -1008,7 +1009,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
!SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) )
{
QueryBox aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail);
- USHORT nRet = aQuery.Execute();
+ sal_uInt16 nRet = aQuery.Execute();
if(RET_YES == nRet )
{
SfxAllItemSet aSet(pTargetView->GetPool());
@@ -1020,8 +1021,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(nRet != RET_OK && nRet != RET_YES)
return 0;
}
- //create the send dialog
- SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
//add the documents
sal_uInt32 nBegin = 0;
sal_uInt32 nEnd = 0;
@@ -1041,12 +1040,31 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
rtl_TextEncoding eEncoding = ::gsl_getSystemTextEncoding();
SfxFilterContainer* pFilterContainer = SwDocShell::Factory().GetFilterContainer();
const SfxFilter *pSfxFlt = 0;
- ULONG nDocType = (ULONG)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos());
+ sal_uLong nDocType = (sal_uLong)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos());
String sExtension = lcl_GetExtensionForDocType(nDocType);
switch( nDocType )
{
case MM_DOCTYPE_OOO : break;
- case MM_DOCTYPE_PDF : break;
+ case MM_DOCTYPE_PDF :
+ {
+ //the method SwIOSystemGetFilterOfFormat( ) returns the template filter
+ //because it uses the same user data :-(
+ SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
+ SfxFilterMatcherIter aIter( &aMatcher );
+ const SfxFilter* pFilter = aIter.First();
+ String sFilterMime( String::CreateFromAscii( "application/pdf" ));
+ while ( pFilter )
+ {
+ if( pFilter->GetMimeType() == sFilterMime && pFilter->CanExport() )
+ {
+ pSfxFlt = pFilter;
+ break;
+ }
+ pFilter = aIter.Next();
+ }
+
+ }
+ break;
case MM_DOCTYPE_WORD:
{
//the method SwIOSystemGetFilterOfFormat( ) returns the template filter
@@ -1112,7 +1130,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
++nTokenCount;
}
sAttach.SetToken( nTokenCount - 1, '.', lcl_GetExtensionForDocType(
- (ULONG)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos())));
+ (sal_uLong)m_aSendAsLB.GetEntryData(m_aSendAsLB.GetSelectEntryPos())));
m_aAttachmentED.SetText(sAttach);
}
else
@@ -1130,8 +1148,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(MM_DOCTYPE_TEXT == nDocType)
{
SwAsciiOptions aOpt;
- USHORT nAppScriptType = GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
- USHORT nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType);
+ sal_uInt16 nAppScriptType = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
+ sal_uInt16 nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType);
aOpt.SetLanguage( ((SvxLanguageItem&)pTargetView->GetWrtShell().
GetDefault( nWhich )).GetLanguage());
aOpt.SetParaFlags( LINEEND_CR );
@@ -1152,6 +1170,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY);
xStore->storeToURL( sTargetTempURL, aValues );
+ //create the send dialog
+ SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
pDlg->SetDocumentCount( nEnd );
pDlg->ShowDialog();
//help to force painting the dialog
@@ -1165,7 +1185,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
SwDocMergeInfo& rInfo = rConfigItem.GetDocumentMergeInfo(nDoc);
//now extract a document from the target document
- SfxObjectShellRef xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
+ // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here
+ SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xTempDocShell->DoInitNew( 0 );
SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 );
SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() );
@@ -1179,7 +1200,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
pTempView->GetDocShell()->LoadStylesFromFile(
sTargetTempURL, aOpt, sal_True );
pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(),
- (USHORT)rInfo.nStartPageInTarget, (USHORT)rInfo.nEndPageInTarget );
+ (sal_uInt16)rInfo.nStartPageInTarget, (sal_uInt16)rInfo.nEndPageInTarget );
pTargetView->GetWrtShell().EndAction();
//then save it
@@ -1216,7 +1237,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
{
{
//read in the temporary file and use it as mail body
- SfxMedium aMedium( aName.GetValue(), STREAM_READ, TRUE);
+ SfxMedium aMedium( aName.GetValue(), STREAM_READ, sal_True);
SvStream* pInStream = aMedium.GetInStream();
if(pInStream)
pInStream->SetStreamCharSet( eEncoding );
diff --git a/sw/source/ui/dbui/mmoutputpage.src b/sw/source/ui/dbui/mmoutputpage.src
index 29e54bbb40..4801706083 100644
--- a/sw/source/ui/dbui/mmoutputpage.src
+++ b/sw/source/ui/dbui/mmoutputpage.src
@@ -48,24 +48,28 @@ TabPage DLG_MM_OUTPUT_PAGE
};
RadioButton RB_SAVESTARTDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVESTARTDOC";
Pos = MAP_APPFONT ( 45 , 40 ) ;
Size = MAP_APPFONT ( 209 , 10 ) ;
Text[ en-US ] = "~Save starting document";
};
RadioButton RB_SAVEMERGEDDOC
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEMERGEDDOC";
Pos = MAP_APPFONT ( 45 , 53 ) ;
Size = MAP_APPFONT ( 209 , 10 ) ;
Text[ en-US ] = "Save ~merged document" ;
};
RadioButton RB_PRINT
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_PRINT";
Pos = MAP_APPFONT ( 45 , 66 ) ;
Size = MAP_APPFONT ( 209 , 10 ) ;
Text[ en-US ] = "~Print merged document";
};
RadioButton RB_SENDMAIL
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SENDMAIL";
Pos = MAP_APPFONT ( 45 , 79 ) ;
Size = MAP_APPFONT ( 209 , 10 ) ;
Text[ en-US ] = "Send merged document as ~E-Mail";
@@ -77,30 +81,35 @@ TabPage DLG_MM_OUTPUT_PAGE
};
PushButton PB_SAVESTARTDOC
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SAVESTARTDOC";
Pos = MAP_APPFONT ( 55 , 108 ) ;
Size = MAP_APPFONT ( 100 , 14 ) ;
Text[ en-US ] = "Save starting ~document";
};
RadioButton RB_SAVEASONE
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEASONE";
Pos = MAP_APPFONT ( 45 , 109 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "S~ave as single document";
};
RadioButton RB_SAVEINDIVIDUAL
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SAVEINDIVIDUAL";
Pos = MAP_APPFONT ( 45, 123 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "Sa~ve as individual documents";
};
RadioButton RB_FROM
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_FROM";
Pos = MAP_APPFONT ( 45 , 137 ) ;
Size = MAP_APPFONT ( 30 , 10 ) ;
Text[ en-US ] = "~From";
};
NumericField NF_FROM
{
+ HelpID = "sw:NumericField:DLG_MM_OUTPUT_PAGE:NF_FROM";
Pos = MAP_APPFONT ( 78 , 136 ) ;
Size = MAP_APPFONT ( 20 , 10 ) ;
Border = TRUE;
@@ -120,6 +129,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
NumericField NF_TO
{
+ HelpID = "sw:NumericField:DLG_MM_OUTPUT_PAGE:NF_TO";
Pos = MAP_APPFONT ( 124 , 136 ) ;
Size = MAP_APPFONT ( 20 , 10 ) ;
Border = TRUE;
@@ -132,6 +142,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
PushButton PB_SAVENOW
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SAVENOW";
Pos = MAP_APPFONT ( 45 , 150 ) ;
Size = MAP_APPFONT ( 80 , 14 ) ;
Text[ en-US ] = "Save Do~cuments";
@@ -144,6 +155,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
ListBox LB_PRINT
{
+ HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_PRINT";
Pos = MAP_APPFONT ( 45 , 109 ) ;
Size = MAP_APPFONT ( 147 , 50 ) ;
Border = TRUE;
@@ -152,18 +164,21 @@ TabPage DLG_MM_OUTPUT_PAGE
};
PushButton PB_PRINTERSETTINGS
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_PRINTERSETTINGS";
Pos = MAP_APPFONT ( 198 , 108 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "P~roperties...";
};
RadioButton RB_PRINTALL
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_PRINTALL";
Pos = MAP_APPFONT ( 45 , 126 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "Print ~all documents";
};
PushButton PB_PRINTNOW
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_PRINTNOW";
Pos = MAP_APPFONT ( 45 , 155 ) ;
Size = MAP_APPFONT ( 80 , 14 ) ;
Text[ en-US ] = "Prin~t Documents";
@@ -177,6 +192,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
ListBox LB_MAILTO
{
+ HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_MAILTO";
Pos = MAP_APPFONT ( 45 , 109 ) ;
Size = MAP_APPFONT ( 147 , 50 ) ;
DropDown = TRUE;
@@ -184,6 +200,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
PushButton PB_COPYTO
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_COPYTO";
Pos = MAP_APPFONT ( 198 , 108 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Copy to...";
@@ -196,6 +213,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
Edit ED_SUBJECT
{
+ HelpID = "sw:Edit:DLG_MM_OUTPUT_PAGE:ED_SUBJECT";
Pos = MAP_APPFONT ( 45 , 125 ) ;
Size = MAP_APPFONT ( 147 , 12 ) ;
Border = TRUE;
@@ -208,6 +226,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
ListBox LB_SENDAS
{
+ HelpID = "sw:ListBox:DLG_MM_OUTPUT_PAGE:LB_SENDAS";
Pos = MAP_APPFONT ( 45 , 141 ) ;
Size = MAP_APPFONT (147 , 70 ) ;
DropDown = TRUE;
@@ -231,6 +250,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
PushButton PB_SENDAS
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SENDAS";
Pos = MAP_APPFONT ( 198 , 140 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "Pr~operties...";
@@ -243,18 +263,21 @@ TabPage DLG_MM_OUTPUT_PAGE
};
Edit ED_ATTACHMENT
{
+ HelpID = "sw:Edit:DLG_MM_OUTPUT_PAGE:ED_ATTACHMENT";
Pos = MAP_APPFONT ( 45 , 168 ) ;
Size = MAP_APPFONT ( 147 , 12 ) ;
Border = TRUE;
};
RadioButton RB_SENDALL
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUT_PAGE:RB_SENDALL";
Pos = MAP_APPFONT ( 45 , 184 ) ;
Size = MAP_APPFONT ( 153 , 10 ) ;
Text[ en-US ] = "S~end all documents";
};
PushButton PB_SENDDOCUMENTS
{
+ HelpID = "sw:PushButton:DLG_MM_OUTPUT_PAGE:PB_SENDDOCUMENTS";
Pos = MAP_APPFONT ( 45 , 212 ) ;
Size = MAP_APPFONT ( 80 , 14 ) ;
Text[ en-US ] = "Se~nd documents";
@@ -321,6 +344,7 @@ ModalDialog DLG_MM_COPYTO
};
Edit ED_CC
{
+ HelpID = "sw:Edit:DLG_MM_COPYTO:ED_CC";
Pos = MAP_APPFONT ( 40 , 15 ) ;
Size = MAP_APPFONT ( 204 , 12 ) ;
Border = TRUE;
@@ -333,6 +357,7 @@ ModalDialog DLG_MM_COPYTO
};
Edit ED_BCC
{
+ HelpID = "sw:Edit:DLG_MM_COPYTO:ED_BCC";
Pos = MAP_APPFONT ( 40 , 31 ) ;
Size = MAP_APPFONT ( 204 , 12 ) ;
Border = TRUE;
@@ -396,6 +421,7 @@ ModalDialog DLG_MM_SAVEWARNING
};
Edit ED_FILENAME
{
+ HelpID = "sw:Edit:DLG_MM_SAVEWARNING:ED_FILENAME";
Pos = MAP_APPFONT ( 40 , 50 ) ;
Size = MAP_APPFONT ( 154 , 12 ) ;
Border = TRUE;
@@ -439,6 +465,7 @@ ModalDialog DLG_MM_QUERY
};
Edit ED_TEXT
{
+ HelpID = "sw:Edit:DLG_MM_QUERY:ED_TEXT";
Pos = MAP_APPFONT ( 40 , 39 ) ;
Size = MAP_APPFONT ( 194 , 12 ) ;
Border = TRUE;
diff --git a/sw/source/ui/dbui/mmoutputtypepage.src b/sw/source/ui/dbui/mmoutputtypepage.src
index a6dd74cc7a..72d7e39365 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.src
+++ b/sw/source/ui/dbui/mmoutputtypepage.src
@@ -48,12 +48,14 @@ TabPage DLG_MM_OUTPUTTYPE_PAGE
};
RadioButton RB_LETTER
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUTTYPE_PAGE:RB_LETTER";
Pos = MAP_APPFONT ( 12 , 43 ) ;
Size = MAP_APPFONT ( 240 , 10 ) ;
Text[ en-US ] = "~Letter";
};
RadioButton RB_MAIL
{
+ HelpID = "sw:RadioButton:DLG_MM_OUTPUTTYPE_PAGE:RB_MAIL";
Pos = MAP_APPFONT ( 12 , 57 ) ;
Size = MAP_APPFONT ( 240 , 10 ) ;
Text[ en-US ] = "~E-mail message";
diff --git a/sw/source/ui/dbui/mmpreparemergepage.src b/sw/source/ui/dbui/mmpreparemergepage.src
index b1ecd375d4..c763cfa465 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.src
+++ b/sw/source/ui/dbui/mmpreparemergepage.src
@@ -57,6 +57,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
PushButton PB_FIRST
{
+ HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_FIRST";
Pos = MAP_APPFONT ( 75 , 55 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = "|<" ;
@@ -64,6 +65,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
PushButton PB_PREV
{
+ HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_PREV";
Pos = MAP_APPFONT ( 98 , 55 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = "<" ;
@@ -71,6 +73,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
NumericField ED_RECORD
{
+ HelpID = "sw:NumericField:DLG_MM_PREPAREMERGE_PAGE:ED_RECORD";
Pos = MAP_APPFONT ( 121 , 56 ) ;
Size = MAP_APPFONT ( 20 , 12 ) ;
Border = TRUE ;
@@ -83,6 +86,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
PushButton PB_NEXT
{
+ HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_NEXT";
Pos = MAP_APPFONT ( 144 , 55 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = ">" ;
@@ -90,6 +94,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
PushButton PB_LAST
{
+ HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_LAST";
Pos = MAP_APPFONT ( 167 , 55 ) ;
Size = MAP_APPFONT ( 20 , 14 ) ;
Text = ">|" ;
@@ -97,6 +102,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
CheckBox CB_EXCLUDE
{
+ HelpID = "sw:CheckBox:DLG_MM_PREPAREMERGE_PAGE:CB_EXCLUDE";
Pos = MAP_APPFONT ( 75, 77 ) ;
Size = MAP_APPFONT ( 179 , 10 ) ;
Text[ en-US ] = "E~xclude this recipient";
@@ -116,6 +122,7 @@ TabPage DLG_MM_PREPAREMERGE_PAGE
};
PushButton PB_EDIT
{
+ HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_EDIT";
Pos = MAP_APPFONT ( 90 , 185 ) ;
Size = MAP_APPFONT ( 80 , 14 ) ;
Text[ en-US ] = "~Edit Document...";
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 1e31befb3d..1eed784443 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -107,11 +107,11 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent,
static long nTabs[] = {3, 0, aSz.Width()/2, aSz.Width() };
m_aTableLB.SetTabs(&nTabs[0], MAP_PIXEL);
m_aTableLB.SetHelpId(HID_MM_SELECTDBTABLEDDIALOG_LISTBOX);
- m_aTableLB.SetWindowBits( WB_CLIPCHILDREN );
+ m_aTableLB.SetStyle( m_aTableLB.GetStyle() | WB_CLIPCHILDREN );
m_aTableLB.SetSpaceBetweenEntries(3);
m_aTableLB.SetSelectionMode( SINGLE_SELECTION );
m_aTableLB.SetDragDropMode( 0 );
- m_aTableLB.EnableAsyncDrag(FALSE);
+ m_aTableLB.EnableAsyncDrag(sal_False);
m_aPreviewPB.SetClickHdl(LINK(this, SwSelectDBTableDialog, PreviewHdl));
diff --git a/sw/source/ui/dbui/selectdbtabledialog.src b/sw/source/ui/dbui/selectdbtabledialog.src
index 467cb8333e..61d68f6fde 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.src
+++ b/sw/source/ui/dbui/selectdbtabledialog.src
@@ -54,6 +54,7 @@ ModalDialog DLG_MM_SELECTDBTABLEDDIALOG
};
PushButton PB_PREVIEW
{
+ HelpID = "sw:PushButton:DLG_MM_SELECTDBTABLEDDIALOG:PB_PREVIEW";
Pos = MAP_APPFONT ( 6 , 84 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Preview";
diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx
index c27dfe3205..657935b6a0 100644
--- a/sw/source/ui/dbui/swdbtoolsclient.cxx
+++ b/sw/source/ui/dbui/swdbtoolsclient.cxx
@@ -211,7 +211,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
return nRet;
}
-::rtl::OUString SwDbtoolsClient::getValue(
+::rtl::OUString SwDbtoolsClient::getFormattedValue(
const uno::Reference< beans::XPropertySet>& _rxColumn,
const uno::Reference< util::XNumberFormatter>& _rxFormatter,
const lang::Locale& _rLocale,
@@ -223,7 +223,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
getAccessTypeConversion();
rtl::OUString sRet;
if(xConversion.is())
- sRet = xConversion->getValue(_rxColumn, _rxFormatter, _rLocale, _rNullDate);
+ sRet = xConversion->getFormattedValue(_rxColumn, _rxFormatter, _rLocale, _rNullDate);
return sRet;
}