CWS gnumake3: pull in cws removetooltypes01
This commit is contained in:
@@ -142,7 +142,7 @@ TYPEINIT1(SwSrcView, SfxViewShell)
|
||||
--------------------------------------------------*/
|
||||
|
||||
|
||||
void lcl_PrintHeader( OutputDevice &rOutDev, USHORT nPages, USHORT nCurPage, const String& rTitle )
|
||||
void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurPage, const String& rTitle )
|
||||
{
|
||||
short nLeftMargin = LMARGPRN;
|
||||
Size aSz = rOutDev.GetOutputSize();
|
||||
@@ -218,8 +218,8 @@ void lcl_ConvertTabsToSpaces( String& rLine )
|
||||
{
|
||||
if ( rLine.Len() )
|
||||
{
|
||||
USHORT nPos = 0;
|
||||
USHORT nMax = rLine.Len();
|
||||
sal_uInt16 nPos = 0;
|
||||
sal_uInt16 nMax = rLine.Len();
|
||||
while ( nPos < nMax )
|
||||
{
|
||||
if ( rLine.GetChar(nPos) == '\t' )
|
||||
@@ -245,7 +245,7 @@ SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
|
||||
SfxViewShell( pViewFrame, SWSRCVIEWFLAGS ),
|
||||
aEditWin( &pViewFrame->GetWindow(), this ),
|
||||
pSearchItem(0),
|
||||
bSourceSaved(FALSE),
|
||||
bSourceSaved(sal_False),
|
||||
eLoadEncoding(RTL_TEXTENCODING_DONTKNOW)
|
||||
{
|
||||
Init();
|
||||
@@ -261,7 +261,7 @@ SwSrcView::~SwSrcView()
|
||||
SwDocShell* pDocShell = GetDocShell();
|
||||
DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
|
||||
const TextSelection& rSel = aEditWin.GetTextView()->GetSelection();
|
||||
((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< USHORT >( rSel.GetStart().GetPara() ) );
|
||||
((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< sal_uInt16 >( rSel.GetStart().GetPara() ) );
|
||||
|
||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
|
||||
@@ -303,11 +303,11 @@ void SwSrcView::Init()
|
||||
Load(pDocShell);
|
||||
else
|
||||
{
|
||||
aEditWin.SetReadonly(TRUE);
|
||||
aEditWin.SetReadonly(sal_True);
|
||||
}
|
||||
|
||||
// StartListening(*GetViewFrame());
|
||||
StartListening(*pDocShell,TRUE);
|
||||
StartListening(*pDocShell,sal_True);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
@@ -327,7 +327,7 @@ SwDocShell* SwSrcView::GetDocShell()
|
||||
|
||||
void SwSrcView::SaveContent(const String& rTmpFile)
|
||||
{
|
||||
SfxMedium aMedium( rTmpFile, STREAM_WRITE, TRUE);
|
||||
SfxMedium aMedium( rTmpFile, STREAM_WRITE, sal_True);
|
||||
SvStream* pOutStream = aMedium.GetOutStream();
|
||||
pOutStream->SetStreamCharSet( lcl_GetStreamCharSet(eLoadEncoding) );
|
||||
aEditWin.Write(*pOutStream);//, EE_FORMAT_TEXT);
|
||||
@@ -341,7 +341,7 @@ void SwSrcView::SaveContent(const String& rTmpFile)
|
||||
|
||||
void SwSrcView::Execute(SfxRequest& rReq)
|
||||
{
|
||||
USHORT nSlot = rReq.GetSlot();
|
||||
sal_uInt16 nSlot = rReq.GetSlot();
|
||||
TextView* pTextView = aEditWin.GetTextView();
|
||||
switch( nSlot )
|
||||
{
|
||||
@@ -381,7 +381,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
{
|
||||
SfxMedium aMedium( xFP->getFiles().getConstArray()[0],
|
||||
STREAM_WRITE | STREAM_SHARE_DENYNONE,
|
||||
FALSE );
|
||||
sal_False );
|
||||
SvStream* pOutStream = aMedium.GetOutStream();
|
||||
pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding));
|
||||
aEditWin.Write( *pOutStream );
|
||||
@@ -420,11 +420,11 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
{
|
||||
const SfxItemSet* pTmpArgs = rReq.GetArgs();
|
||||
|
||||
USHORT nWhich = pTmpArgs->GetWhichByPos( 0 );
|
||||
sal_uInt16 nWhich = pTmpArgs->GetWhichByPos( 0 );
|
||||
DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" );
|
||||
const SfxPoolItem& rItem = pTmpArgs->Get( nWhich );
|
||||
SetSearchItem( (const SvxSearchItem&)rItem);
|
||||
StartSearchAndReplace( (const SvxSearchItem&)rItem, FALSE, rReq.IsAPI() );
|
||||
StartSearchAndReplace( (const SvxSearchItem&)rItem, sal_False, rReq.IsAPI() );
|
||||
if(aEditWin.IsModified())
|
||||
GetDocShell()->GetDoc()->SetModified();
|
||||
}
|
||||
@@ -434,7 +434,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
SvxSearchItem* pSrchItem = GetSearchItem();
|
||||
if(pSrchItem)
|
||||
{
|
||||
StartSearchAndReplace( *pSrchItem, FALSE, rReq.IsAPI() );
|
||||
StartSearchAndReplace( *pSrchItem, sal_False, rReq.IsAPI() );
|
||||
if(aEditWin.IsModified())
|
||||
GetDocShell()->GetDoc()->SetModified();
|
||||
}
|
||||
@@ -448,11 +448,11 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
break;
|
||||
case SID_UNDO:
|
||||
pTextView->Undo();
|
||||
GetViewFrame()->GetBindings().InvalidateAll(FALSE);
|
||||
GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
||||
break;
|
||||
case SID_REDO:
|
||||
pTextView->Redo();
|
||||
GetViewFrame()->GetBindings().InvalidateAll(FALSE);
|
||||
GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
||||
break;
|
||||
case SID_REPEAT:
|
||||
break;
|
||||
@@ -482,7 +482,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
void SwSrcView::GetState(SfxItemSet& rSet)
|
||||
{
|
||||
SfxWhichIter aIter(rSet);
|
||||
USHORT nWhich = aIter.FirstWhich();
|
||||
sal_uInt16 nWhich = aIter.FirstWhich();
|
||||
TextView* pTextView = aEditWin.GetTextView();
|
||||
|
||||
while(nWhich)
|
||||
@@ -516,7 +516,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
|
||||
break;
|
||||
case SID_SEARCH_OPTIONS:
|
||||
{
|
||||
USHORT nOpt = SRC_SEARCHOPTIONS;
|
||||
sal_uInt16 nOpt = SRC_SEARCHOPTIONS;
|
||||
if(GetDocShell()->IsReadOnly())
|
||||
nOpt &= ~(SEARCH_OPTIONS_REPLACE|SEARCH_OPTIONS_REPLACE_ALL);
|
||||
|
||||
@@ -550,7 +550,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
|
||||
case SID_REDO:
|
||||
{
|
||||
::svl::IUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
|
||||
USHORT nCount = 0;
|
||||
sal_uInt16 nCount = 0;
|
||||
if(nWhich == SID_UNDO)
|
||||
{
|
||||
nCount = rMgr.GetUndoActionCount();
|
||||
@@ -597,7 +597,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
|
||||
TransferableDataHelper aDataHelper(
|
||||
TransferableDataHelper::CreateFromSystemClipboard(
|
||||
&aEditWin) );
|
||||
BOOL bDisable = !aDataHelper.GetXTransferable().is() ||
|
||||
sal_Bool bDisable = !aDataHelper.GetXTransferable().is() ||
|
||||
0 == aDataHelper.GetFormatCount();
|
||||
if( bDisable )
|
||||
rSet.DisableItem(nWhich);
|
||||
@@ -638,20 +638,20 @@ void SwSrcView::SetSearchItem( const SvxSearchItem& rItem )
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
BOOL bFromStart,
|
||||
BOOL bApi,
|
||||
BOOL bRecursive)
|
||||
sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
sal_Bool bFromStart,
|
||||
sal_Bool bApi,
|
||||
sal_Bool bRecursive)
|
||||
{
|
||||
ExtTextView* pTextView = aEditWin.GetTextView();
|
||||
TextSelection aSel;
|
||||
TextPaM aPaM;
|
||||
|
||||
BOOL bForward = !rSearchItem.GetBackward();
|
||||
BOOL bAtStart = pTextView->GetSelection() == TextSelection( aPaM, aPaM );
|
||||
sal_Bool bForward = !rSearchItem.GetBackward();
|
||||
sal_Bool bAtStart = pTextView->GetSelection() == TextSelection( aPaM, aPaM );
|
||||
|
||||
if( !bForward )
|
||||
aPaM = TextPaM( (ULONG)-1, (USHORT)-1 );
|
||||
aPaM = TextPaM( (sal_uLong)-1, (sal_uInt16)-1 );
|
||||
|
||||
if( bFromStart )
|
||||
{
|
||||
@@ -663,8 +663,8 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
aSearchOpt.Locale = SvxCreateLocale(
|
||||
static_cast< LanguageType >( GetAppLanguage() ) );
|
||||
|
||||
USHORT nFound;
|
||||
BOOL bAll = FALSE;
|
||||
sal_uInt16 nFound;
|
||||
sal_Bool bAll = sal_False;
|
||||
switch( rSearchItem.GetCommand() )
|
||||
{
|
||||
case SVX_SEARCHCMD_FIND:
|
||||
@@ -672,7 +672,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
nFound = pTextView->Search( aSearchOpt, bForward );
|
||||
break;
|
||||
|
||||
case SVX_SEARCHCMD_REPLACE_ALL: bAll = TRUE;
|
||||
case SVX_SEARCHCMD_REPLACE_ALL: bAll = sal_True;
|
||||
case SVX_SEARCHCMD_REPLACE:
|
||||
nFound = pTextView->Replace( aSearchOpt, bAll, bForward );
|
||||
break;
|
||||
@@ -683,7 +683,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
|
||||
if( !nFound )
|
||||
{
|
||||
BOOL bNotFoundMessage = FALSE;
|
||||
sal_Bool bNotFoundMessage = sal_False;
|
||||
if(!bRecursive)
|
||||
{
|
||||
if(!bFromStart)
|
||||
@@ -692,13 +692,13 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
}
|
||||
else
|
||||
{
|
||||
bNotFoundMessage = TRUE;
|
||||
bNotFoundMessage = sal_True;
|
||||
pTextView->SetSelection( aSel );
|
||||
}
|
||||
}
|
||||
else if(bAtStart)
|
||||
{
|
||||
bNotFoundMessage = TRUE;
|
||||
bNotFoundMessage = sal_True;
|
||||
}
|
||||
|
||||
|
||||
@@ -713,7 +713,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
: MSG_SEARCH_START)).Execute())
|
||||
{
|
||||
pTextView->SetSelection( TextSelection( aPaM, aPaM ) );
|
||||
StartSearchAndReplace( rSearchItem, FALSE, FALSE, TRUE );
|
||||
StartSearchAndReplace( rSearchItem, sal_False, sal_False, sal_True );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -724,7 +724,7 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
Beschreibung:
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
|
||||
sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
|
||||
{
|
||||
SwDocShell* pDocSh = GetDocShell();
|
||||
if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
|
||||
@@ -734,10 +734,10 @@ USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
|
||||
pDocSh->SetModified();
|
||||
}
|
||||
if ( nDiffFlags & SFX_PRINTER_OPTIONS )
|
||||
::SetPrinter( pDocSh->getIDocumentDeviceAccess(), pNew, TRUE );
|
||||
::SetPrinter( pDocSh->getIDocumentDeviceAccess(), pNew, sal_True );
|
||||
|
||||
const BOOL bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ? TRUE : FALSE;
|
||||
const BOOL bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE ? TRUE : FALSE;
|
||||
const sal_Bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ? sal_True : sal_False;
|
||||
const sal_Bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE ? sal_True : sal_False;
|
||||
if ( bChgOri || bChgSize )
|
||||
{
|
||||
pDocSh->SetModified();
|
||||
@@ -749,7 +749,7 @@ USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool )
|
||||
Beschreibung:
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
SfxPrinter* SwSrcView::GetPrinter( BOOL bCreate )
|
||||
SfxPrinter* SwSrcView::GetPrinter( sal_Bool bCreate )
|
||||
{
|
||||
return GetDocShell()->GetDoc()->getPrinter( bCreate );
|
||||
}
|
||||
@@ -783,32 +783,32 @@ sal_Int32 SwSrcView::PrintSource(
|
||||
|
||||
String aTitle( GetViewFrame()->GetWindow().GetText() );
|
||||
|
||||
USHORT nLineHeight = (USHORT) pOutDev->GetTextHeight(); // etwas mehr.
|
||||
USHORT nParaSpace = 10;
|
||||
sal_uInt16 nLineHeight = (sal_uInt16) pOutDev->GetTextHeight(); // etwas mehr.
|
||||
sal_uInt16 nParaSpace = 10;
|
||||
|
||||
Size aPaperSz = pOutDev->GetOutputSize();
|
||||
aPaperSz.Width() -= (LMARGPRN + RMARGPRN);
|
||||
aPaperSz.Height() -= (TMARGPRN + BMARGPRN);
|
||||
|
||||
// nLinepPage stimmt nicht, wenn Zeilen umgebrochen werden muessen...
|
||||
USHORT nLinespPage = (USHORT) (aPaperSz.Height() / nLineHeight);
|
||||
USHORT nCharspLine = (USHORT) (aPaperSz.Width() / pOutDev->GetTextWidth( 'X' ));
|
||||
USHORT nParas = static_cast< USHORT >( pTextEngine->GetParagraphCount() );
|
||||
sal_uInt16 nLinespPage = (sal_uInt16) (aPaperSz.Height() / nLineHeight);
|
||||
sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pOutDev->GetTextWidth( 'X' ));
|
||||
sal_uInt16 nParas = static_cast< sal_uInt16 >( pTextEngine->GetParagraphCount() );
|
||||
|
||||
USHORT nPages = (USHORT) (nParas / nLinespPage + 1 );
|
||||
USHORT nCurPage = 1;
|
||||
sal_uInt16 nPages = (sal_uInt16) (nParas / nLinespPage + 1 );
|
||||
sal_uInt16 nCurPage = 1;
|
||||
|
||||
// Header drucken...
|
||||
if (!bCalcNumPagesOnly && nPage == nCurPage)
|
||||
lcl_PrintHeader( *pOutDev, nPages, nCurPage, aTitle );
|
||||
const Point aStartPos( LMARGPRN, TMARGPRN );
|
||||
Point aPos( aStartPos );
|
||||
for ( USHORT nPara = 0; nPara < nParas; ++nPara )
|
||||
for ( sal_uInt16 nPara = 0; nPara < nParas; ++nPara )
|
||||
{
|
||||
String aLine( pTextEngine->GetText( nPara ) );
|
||||
lcl_ConvertTabsToSpaces( aLine );
|
||||
USHORT nLines = aLine.Len() / nCharspLine + 1;
|
||||
for ( USHORT nLine = 0; nLine < nLines; ++nLine )
|
||||
sal_uInt16 nLines = aLine.Len() / nCharspLine + 1;
|
||||
for ( sal_uInt16 nLine = 0; nLine < nLines; ++nLine )
|
||||
{
|
||||
String aTmpLine( aLine, nLine * nCharspLine, nCharspLine );
|
||||
aPos.Y() += nLineHeight;
|
||||
@@ -851,7 +851,7 @@ void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
|
||||
{
|
||||
// Broadcast kommt nur einmal!
|
||||
const SwDocShell* pDocSh = GetDocShell();
|
||||
const BOOL bReadonly = pDocSh->IsReadOnly();
|
||||
const sal_Bool bReadonly = pDocSh->IsReadOnly();
|
||||
aEditWin.SetReadonly(bReadonly);
|
||||
}
|
||||
SfxViewShell::Notify(rBC, rHint);
|
||||
@@ -872,8 +872,8 @@ void SwSrcView::Load(SwDocShell* pDocShell)
|
||||
SfxMedium* pMedium = pDocShell->GetMedium();
|
||||
|
||||
const SfxFilter* pFilter = pMedium->GetFilter();
|
||||
BOOL bHtml = pFilter && pFilter->GetUserData().EqualsAscii("HTML");
|
||||
BOOL bDocModified = pDocShell->IsModified();
|
||||
sal_Bool bHtml = pFilter && pFilter->GetUserData().EqualsAscii("HTML");
|
||||
sal_Bool bDocModified = pDocShell->IsModified();
|
||||
if(bHtml && !bDocModified && pDocShell->HasName())
|
||||
{
|
||||
SvStream* pStream = pMedium->GetInStream();
|
||||
@@ -897,9 +897,9 @@ void SwSrcView::Load(SwDocShell* pDocShell)
|
||||
pStream->SetStreamCharSet( eDestEnc );
|
||||
pStream->Seek(0);
|
||||
TextEngine* pTextEngine = aEditWin.GetTextEngine();
|
||||
pTextEngine->EnableUndo(FALSE);
|
||||
pTextEngine->EnableUndo(sal_False);
|
||||
aEditWin.Read(*pStream);//, EE_FORMAT_TEXT);
|
||||
pTextEngine->EnableUndo(TRUE);
|
||||
pTextEngine->EnableUndo(sal_True);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -915,18 +915,18 @@ void SwSrcView::Load(SwDocShell* pDocShell)
|
||||
SvtSaveOptions aOpt;
|
||||
|
||||
{
|
||||
SfxMedium aMedium( sFileURL,STREAM_READWRITE, TRUE );
|
||||
SfxMedium aMedium( sFileURL,STREAM_READWRITE, sal_True );
|
||||
SwWriter aWriter( aMedium, *pDocShell->GetDoc() );
|
||||
WriterRef xWriter;
|
||||
::GetHTMLWriter(aEmptyStr, aMedium.GetBaseURL( true ), xWriter);
|
||||
String sWriteName = pDocShell->HasName() ?
|
||||
pMedium->GetName() :
|
||||
(const String&) sFileURL;
|
||||
ULONG nRes = aWriter.Write(xWriter, &sWriteName);
|
||||
sal_uLong nRes = aWriter.Write(xWriter, &sWriteName);
|
||||
if(nRes)
|
||||
{
|
||||
ErrorHandler::HandleError(ErrCode(nRes));
|
||||
aEditWin.SetReadonly(TRUE);
|
||||
aEditWin.SetReadonly(sal_True);
|
||||
}
|
||||
aMedium.Commit();
|
||||
SvStream* pInStream = aMedium.GetInStream();
|
||||
@@ -944,9 +944,9 @@ void SwSrcView::Load(SwDocShell* pDocShell)
|
||||
if(bDocModified)
|
||||
pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt
|
||||
// AutoLoad abschalten
|
||||
pDocShell->SetAutoLoad(INetURLObject(), 0, FALSE);
|
||||
pDocShell->SetAutoLoad(INetURLObject(), 0, sal_False);
|
||||
DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
|
||||
USHORT nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
|
||||
sal_uInt16 nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
|
||||
aEditWin.SetStartLine(nLine);
|
||||
aEditWin.GetTextEngine()->ResetUndo();
|
||||
aEditWin.GetOutWin()->GrabFocus();
|
||||
|
Reference in New Issue
Block a user