Kaydet (Commit) dd8a400b authored tarafından Jochen Nitschke's avatar Jochen Nitschke Kaydeden (comit) Noel Grandin

vcl: remove dead TextAttribHyperLink

couldn't even find a proper ctor beside copy-ctor

since commit e19c00ed
Date:   Wed Jul 13 13:30:48 2011 +0200
    callcatcher: remove unused TextAttrib stuff

Change-Id: Ia7f0bd1dcc725beb8cc53bb82372a4cce3ec68b0
Reviewed-on: https://gerrit.libreoffice.org/41012Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e7c0bd4d
......@@ -1056,7 +1056,6 @@ void Document::retrieveRunAttributesImpl(
::sal_uLong nNumber = static_cast< ::sal_uLong >( pParagraph->getNumber() );
::TextPaM aPaM( nNumber, Index );
// XXX numeric overflow
// FIXME TEXTATTR_HYPERLINK ignored:
::TextAttribFontColor const * pColor
= static_cast< ::TextAttribFontColor const * >(
m_rEngine.FindAttrib( aPaM, TEXTATTR_FONTCOLOR ) );
......
......@@ -30,7 +30,6 @@
namespace vcl { class Font; }
#define TEXTATTR_FONTCOLOR 1
#define TEXTATTR_HYPERLINK 2
#define TEXTATTR_FONTWEIGHT 3
#define TEXTATTR_USER_START 1000 //start id for user defined text attributes
......@@ -95,24 +94,6 @@ public:
FontWeight getFontWeight() const { return meWeight; }
};
class TextAttribHyperLink : public TextAttrib
{
private:
OUString maURL;
OUString maDescription;
Color maColor;
public:
TextAttribHyperLink( const TextAttribHyperLink& rAttr );
virtual ~TextAttribHyperLink() override;
const OUString& GetURL() const { return maURL; }
virtual void SetFont( vcl::Font& rFont ) const override;
virtual TextAttrib* Clone() const override;
virtual bool operator==( const TextAttrib& rAttr ) const override;
};
class VCL_DLLPUBLIC TextAttribProtect : public TextAttrib
{
public:
......
......@@ -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>" );
......
......@@ -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;
......
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment