diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-08-11 10:30:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-11 13:44:29 +0200 |
commit | dd8a400bbbb1b8d5592a870f2036a4df3d005a7d (patch) | |
tree | b2ca1cf048b04f2fb1ba8b20f3ccf86d2f8e6b96 /vcl | |
parent | e7c0bd4df01744a744847a94c7a04746787e5157 (diff) |
vcl: remove dead TextAttribHyperLink
couldn't even find a proper ctor beside copy-ctor
since commit e19c00ed76f5d46c3b88d2721b9ac84fcaaed97c
Date: Wed Jul 13 13:30:48 2011 +0200
callcatcher: remove unused TextAttrib stuff
Change-Id: Ia7f0bd1dcc725beb8cc53bb82372a4cce3ec68b0
Reviewed-on: https://gerrit.libreoffice.org/41012
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 27 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 30 | ||||
-rw-r--r-- | vcl/source/edit/txtattr.cxx | 29 |
3 files changed, 3 insertions, 83 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 188a3769f34e..769e2927d2ed 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2495,31 +2495,8 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML } else { - sal_Int32 nTmpStart = nStartPos; - sal_Int32 nTmpEnd; - do - { - const TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos ); - nTmpEnd = pAttr ? pAttr->GetStart() : nEndPos; - - // Text before Attribute - aText.append( pNode->GetText().copy( nTmpStart, nTmpEnd-nTmpStart ) ); - - if ( pAttr ) - { - nTmpEnd = std::min( pAttr->GetEnd(), nEndPos ); - - // e.g. <A HREF="http://www.mopo.de/">Morgenpost</A> - aText.append( "<A HREF=\"" ); - aText.append( static_cast<const TextAttribHyperLink&>( pAttr->GetAttr() ).GetURL() ); - aText.append( "\">" ); - nTmpStart = pAttr->GetStart(); - aText.append( pNode->GetText().copy( nTmpStart, nTmpEnd-nTmpStart ) ); - aText.append( "</A>" ); - - nTmpStart = pAttr->GetEnd(); - } - } while ( nTmpEnd < nEndPos ); + // Text before Attribute + aText.append( pNode->GetText().copy( nStartPos, nEndPos-nStartPos ) ); } aText.append( "</P>" ); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 366aa5bfaf6a..ae9fac5aba7f 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -1038,9 +1038,6 @@ void TextView::Copy( css::uno::Reference< css::datatransfer::clipboard::XClipboa { TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); - if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // then also as HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, true ); - SolarMutexReleaser aReleaser; try @@ -1752,11 +1749,10 @@ bool TextView::IsSelectionAtPoint( const Point& rPosPixel ) { Point aDocPos = GetDocPos( rPosPixel ); TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos ); - // For Hyperlinks D&D also start w/o a selection. // BeginDrag is only called, however, if IsSelectionAtPoint() // Problem: IsSelectionAtPoint is not called by Command() // if before MBDown returned false. - return IsInSelection( aPaM ) || mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ); + return IsInSelection( aPaM ); } bool TextView::IsInSelection( const TextPaM& rPaM ) @@ -1882,30 +1878,6 @@ void TextView::dragGestureRecognized( const css::datatransfer::dnd::DragGestureE TETextDataObject* pDataObj = new TETextDataObject( GetSelected() ); - if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // then also as HTML - mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, true ); - - /* - // D&D of a Hyperlink - // TODO: Better would be to store MBDownPaM in MBDown, - // but this would be incompatible => change later - TextPaM aPaM( mpImpl->mpTextEngine->GetPaM( GetDocPos( GetWindow()->GetPointerPosPixel() ) ) ); - const TextCharAttrib* pAttr = mpImpl->mpTextEngine->FindCharAttrib( aPaM, TEXTATTR_HYPERLINK ); - if ( pAttr ) - { - aSel = aPaM; - aSel.GetStart().GetIndex() = pAttr->GetStart(); - aSel.GetEnd().GetIndex() = pAttr->GetEnd(); - - const TextAttribHyperLink& rLink = (const TextAttribHyperLink&)pAttr->GetAttr(); - String aText( rLink.GetDescription() ); - if ( !aText.Len() ) - aText = mpImpl->mpTextEngine->GetText( aSel ); - INetBookmark aBookmark( rLink.GetURL(), aText ); - aBookmark.CopyDragServer(); - } - */ - mpImpl->mpCursor->Hide(); sal_Int8 nActions = css::datatransfer::dnd::DNDConstants::ACTION_COPY; diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx index 23e0c02cd281..4065995314ec 100644 --- a/vcl/source/edit/txtattr.cxx +++ b/vcl/source/edit/txtattr.cxx @@ -89,35 +89,6 @@ bool TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const ( meWeight == static_cast<const TextAttribFontWeight&>(rAttr).meWeight ) ); } -TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr ) - : TextAttrib( rAttr ), maURL( rAttr.maURL ), maDescription( rAttr.maDescription ) -{ - maColor = rAttr.maColor; -} - -TextAttribHyperLink::~TextAttribHyperLink() -{ -} - -void TextAttribHyperLink::SetFont( vcl::Font& rFont ) const -{ - rFont.SetColor( maColor ); - rFont.SetUnderline( LINESTYLE_SINGLE ); -} - -TextAttrib* TextAttribHyperLink::Clone() const -{ - return new TextAttribHyperLink( *this ); -} - -bool TextAttribHyperLink::operator==( const TextAttrib& rAttr ) const -{ - return ( ( TextAttrib::operator==(rAttr ) ) && - ( maURL == static_cast<const TextAttribHyperLink&>(rAttr).maURL ) && - ( maDescription == static_cast<const TextAttribHyperLink&>(rAttr).maDescription ) && - ( maColor == static_cast<const TextAttribHyperLink&>(rAttr).maColor ) ); -} - TextAttribProtect::TextAttribProtect() : TextAttrib( TEXTATTR_PROTECTED ) { |