Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / dialog / imapwnd.cxx
blob45ad2a9e9e26f8a9d69f389d44cefa2504478ac0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <tools/urlobj.hxx>
21 #include <vcl/commandevent.hxx>
22 #include <vcl/imaprect.hxx>
23 #include <vcl/imapcirc.hxx>
24 #include <vcl/imappoly.hxx>
25 #include <vcl/svapp.hxx>
26 #include <svl/urlbmk.hxx>
28 #include <svx/svxids.hrc>
29 #include "imapwnd.hxx"
30 #include <svx/svdpage.hxx>
31 #include <svx/svdorect.hxx>
32 #include <svx/svdocirc.hxx>
33 #include <svx/svdopath.hxx>
34 #include <svx/xfltrit.hxx>
35 #include <svx/svdpagv.hxx>
36 #include <svx/xfillit0.hxx>
37 #include <svx/xflclit.hxx>
38 #include <svx/xlnclit.hxx>
40 #include <sfx2/evntconf.hxx>
42 #include <sot/formats.hxx>
44 #include <svx/svxdlg.hxx>
45 #include <basegfx/polygon/b2dpolygon.hxx>
46 #include <memory>
48 using namespace com::sun::star;
49 using ::com::sun::star::frame::XFrame;
50 using ::com::sun::star::uno::Reference;
52 #define TRANSCOL COL_WHITE
54 IMapWindow::IMapWindow(const Reference< XFrame >& rxDocumentFrame, weld::Dialog* pDialog)
55 : GraphCtrl(pDialog)
56 , mxDocumentFrame(rxDocumentFrame)
58 pIMapPool = new SfxItemPool( "IMapItemPool",
59 SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, maItemInfos );
60 pIMapPool->FreezeIdRanges();
63 IMapWindow::~IMapWindow()
67 void IMapWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
69 Size aSize(pDrawingArea->get_ref_device().LogicToPixel(Size(270, 170), MapMode(MapUnit::MapAppFont)));
70 pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
71 SetOutputSizePixel(aSize);
72 weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
74 SetSdrMode(true);
76 mxDropTargetHelper.reset(new IMapDropTargetHelper(*this));
79 void IMapWindow::SetImageMap( const ImageMap& rImageMap )
81 ReplaceImageMap( rImageMap );
84 void IMapWindow::ReplaceImageMap( const ImageMap& rImageMap )
86 SdrPage* pPage = nullptr;
87 aIMap = rImageMap;
89 if(GetSdrModel())
91 // try to access page
92 pPage = GetSdrModel()->GetPage(0);
95 if(pPage)
97 // clear SdrObjects with broadcasting
98 pPage->ClearSdrObjList();
101 if(GetSdrView())
103 // #i63762# reset selection at view
104 GetSdrView()->UnmarkAllObj();
107 // create new drawing objects
108 const sal_uInt16 nCount(rImageMap.GetIMapObjectCount());
110 for ( sal_uInt16 i(nCount); i > 0; i-- )
112 rtl::Reference<SdrObject> pNewObj = CreateObj( rImageMap.GetIMapObject( i - 1 ) );
114 if (pNewObj && pPage)
116 pPage->InsertObject( pNewObj.get() );
121 void IMapWindow::ReplaceActualIMapInfo( const NotifyInfo& rNewInfo )
123 const SdrObject* pSdrObj = GetSelectedSdrObject();
125 if ( pSdrObj )
127 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
128 if (pIMapObj)
130 pIMapObj->SetURL( rNewInfo.aMarkURL );
131 pIMapObj->SetAltText( rNewInfo.aMarkAltText );
132 pIMapObj->SetTarget( rNewInfo.aMarkTarget );
133 pModel->SetChanged();
134 UpdateInfo( false );
139 const ImageMap& IMapWindow::GetImageMap()
141 if ( pModel->IsChanged() )
143 SdrPage* pPage = pModel->GetPage( 0 );
145 if ( pPage )
147 const size_t nCount = pPage->GetObjCount();
149 aIMap.ClearImageMap();
151 for ( size_t i = nCount; i; )
153 --i;
154 aIMap.InsertIMapObject( *( static_cast<IMapUserData*>( pPage->GetObj( i )->GetUserData( 0 ) )->GetObject() ) );
158 pModel->SetChanged( false );
161 return aIMap;
164 void IMapWindow::SetTargetList( const TargetList& rTargetList )
166 // Delete old List
167 // Fill with the provided list
168 aTargetList = rTargetList;
170 pModel->SetChanged( false );
173 rtl::Reference<SdrObject> IMapWindow::CreateObj( const IMapObject* pIMapObj )
175 tools::Rectangle aClipRect( Point(), GetGraphicSize() );
176 rtl::Reference<SdrObject> pSdrObj;
177 IMapObjectPtr pCloneIMapObj;
179 switch( pIMapObj->GetType() )
181 case IMapObjectType::Rectangle:
183 const IMapRectangleObject* pIMapRectObj = static_cast<const IMapRectangleObject*>(pIMapObj);
184 tools::Rectangle aDrawRect( pIMapRectObj->GetRectangle( false ) );
186 // clipped on CanvasPane
187 aDrawRect.Intersection( aClipRect );
189 pSdrObj = new SdrRectObj(*pModel, aDrawRect);
190 pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapRectangleObject( *pIMapRectObj )));
192 break;
194 case IMapObjectType::Circle:
196 const IMapCircleObject* pIMapCircleObj = static_cast<const IMapCircleObject*>(pIMapObj);
197 const Point aCenter( pIMapCircleObj->GetCenter( false ) );
198 const tools::Long nRadius = pIMapCircleObj->GetRadius( false );
199 const Point aOffset( nRadius, nRadius );
200 tools::Rectangle aCircle( aCenter - aOffset, aCenter + aOffset );
202 // limited to CanvasPane
203 aCircle.Intersection( aClipRect );
205 pSdrObj = new SdrCircObj(
206 *pModel,
207 SdrCircKind::Full,
208 aCircle,
209 0_deg100,
210 36000_deg100);
211 pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapCircleObject( *pIMapCircleObj )));
213 break;
215 case IMapObjectType::Polygon:
217 const IMapPolygonObject* pIMapPolyObj = static_cast<const IMapPolygonObject*>(pIMapObj);
219 // If it actually is an ellipse, then another ellipse is created again
220 if ( pIMapPolyObj->HasExtraEllipse() )
222 tools::Rectangle aDrawRect( pIMapPolyObj->GetExtraEllipse() );
224 // clipped on CanvasPane
225 aDrawRect.Intersection( aClipRect );
227 pSdrObj = new SdrCircObj(
228 *pModel,
229 SdrCircKind::Full,
230 aDrawRect,
231 0_deg100,
232 36000_deg100);
234 else
236 const tools::Polygon& rPoly = pIMapPolyObj->GetPolygon( false );
237 tools::Polygon aDrawPoly( rPoly );
239 // clipped on CanvasPane
240 aDrawPoly.Clip( aClipRect );
242 basegfx::B2DPolygon aPolygon;
243 aPolygon.append(aDrawPoly.getB2DPolygon());
244 pSdrObj = new SdrPathObj(
245 *pModel,
246 SdrObjKind::Polygon,
247 basegfx::B2DPolyPolygon(aPolygon));
250 pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapPolygonObject( *pIMapPolyObj )));
252 break;
254 default:
255 break;
258 if ( pSdrObj )
260 SfxItemSet aSet( pModel->GetItemPool() );
262 aSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
263 aSet.Put( XFillColorItem( "", TRANSCOL ) );
265 if ( !pIMapObj->IsActive() )
267 aSet.Put( XFillTransparenceItem( 100 ) );
268 aSet.Put( XLineColorItem( "", COL_RED ) );
270 else
272 aSet.Put( XFillTransparenceItem( 50 ) );
273 aSet.Put( XLineColorItem( "", COL_BLACK ) );
276 pSdrObj->SetMergedItemSetAndBroadcast(aSet);
278 pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pCloneIMapObj )) );
279 pSdrObj->SetUserCall( GetSdrUserCall() );
282 return pSdrObj;
285 void IMapWindow::InitSdrModel()
287 GraphCtrl::InitSdrModel();
289 SfxItemSet aSet( pModel->GetItemPool() );
291 aSet.Put( XFillColorItem( "", TRANSCOL ) );
292 aSet.Put( XFillTransparenceItem( 50 ) );
293 pView->SetAttributes( aSet );
294 pView->SetFrameDragSingles();
297 void IMapWindow::SdrObjCreated( const SdrObject& rObj )
299 switch( rObj.GetObjIdentifier() )
301 case SdrObjKind::Rectangle:
303 SdrRectObj* pRectObj = const_cast<SdrRectObj*>(static_cast<const SdrRectObj*>(&rObj));
304 auto pObj = std::make_shared<IMapRectangleObject>( pRectObj->GetLogicRect(), "", "", "", "", "", true, false );
306 pRectObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
308 break;
310 case SdrObjKind::CircleOrEllipse:
312 SdrCircObj* pCircObj = const_cast<SdrCircObj*>( static_cast<const SdrCircObj*>(&rObj) );
313 rtl::Reference<SdrPathObj> pPathObj = static_cast<SdrPathObj*>( pCircObj->ConvertToPolyObj( false, false ).get() );
314 tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
316 pPathObj.clear();
318 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
319 pObj->SetExtraEllipse( aPoly.GetBoundRect() );
320 pCircObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
322 break;
324 case SdrObjKind::Polygon:
325 case SdrObjKind::FreehandFill:
326 case SdrObjKind::PathPoly:
327 case SdrObjKind::PathFill:
329 SdrPathObj* pPathObj = const_cast<SdrPathObj*>( static_cast<const SdrPathObj*>(&rObj) );
330 const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
332 if ( rXPolyPoly.count() )
334 tools::Polygon aPoly(rXPolyPoly.getB2DPolygon(0));
335 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
336 pPathObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
339 break;
341 default:
342 break;
346 void IMapWindow::SdrObjChanged( const SdrObject& rObj )
348 IMapUserData* pUserData = static_cast<IMapUserData*>( rObj.GetUserData( 0 ) );
350 if ( !pUserData )
351 return;
353 OUString aURL;
354 OUString aAltText;
355 OUString aDesc;
356 OUString aTarget;
357 IMapObjectPtr pIMapObj = pUserData->GetObject();
358 bool bActive = true;
360 if ( pIMapObj )
362 aURL = pIMapObj->GetURL();
363 aAltText = pIMapObj->GetAltText();
364 aDesc = pIMapObj->GetDesc();
365 aTarget = pIMapObj->GetTarget();
366 bActive = pIMapObj->IsActive();
369 switch( rObj.GetObjIdentifier() )
371 case SdrObjKind::Rectangle:
373 pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(),
374 aURL, aAltText, aDesc, aTarget, "", bActive, false ) );
376 break;
378 case SdrObjKind::CircleOrEllipse:
380 const SdrCircObj& rCircObj = static_cast<const SdrCircObj&>(rObj);
381 rtl::Reference<SdrPathObj> pPathObj = static_cast<SdrPathObj*>( rCircObj.ConvertToPolyObj( false, false ).get() );
382 tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
384 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
385 pObj->SetExtraEllipse( aPoly.GetBoundRect() );
387 pPathObj.clear();
389 pUserData->ReplaceObject( pObj );
391 break;
393 case SdrObjKind::Polygon:
394 case SdrObjKind::FreehandFill:
395 case SdrObjKind::PathPoly:
396 case SdrObjKind::PathFill:
398 const SdrPathObj& rPathObj = static_cast<const SdrPathObj&>(rObj);
399 const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
401 if ( rXPolyPoly.count() )
403 tools::Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0));
404 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
405 pUserData->ReplaceObject( pObj );
408 break;
410 default:
411 break;
415 bool IMapWindow::MouseButtonUp(const MouseEvent& rMEvt)
417 bool bRet = GraphCtrl::MouseButtonUp( rMEvt );
418 UpdateInfo( true );
419 return bRet;
422 void IMapWindow::MarkListHasChanged()
424 GraphCtrl::MarkListHasChanged();
425 UpdateInfo( false );
428 SdrObject* IMapWindow::GetHitSdrObj( const Point& rPosPixel ) const
430 OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
432 SdrObject* pObj = nullptr;
433 Point aPt = rDevice.PixelToLogic( rPosPixel );
435 if ( tools::Rectangle( Point(), GetGraphicSize() ).Contains( aPt ) )
437 SdrPage* pPage = pModel->GetPage( 0 );
438 if ( pPage )
440 for ( size_t i = pPage->GetObjCount(); i > 0; )
442 --i;
443 SdrObject* pTestObj = pPage->GetObj( i );
444 IMapObject* pIMapObj = GetIMapObj( pTestObj );
446 if ( pIMapObj && pIMapObj->IsHit( aPt ) )
448 pObj = pTestObj;
449 break;
455 return pObj;
458 IMapObject* IMapWindow::GetIMapObj( const SdrObject* pSdrObj )
460 IMapObject* pIMapObj = nullptr;
462 if ( pSdrObj )
464 IMapUserData* pUserData = static_cast<IMapUserData*>( pSdrObj->GetUserData( 0 ) );
466 if ( pUserData )
467 pIMapObj = pUserData->GetObject().get();
470 return pIMapObj;
473 bool IMapWindow::Command(const CommandEvent& rCEvt)
475 if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
477 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/imapmenu.ui"));
478 mxPopupMenu = xBuilder->weld_menu("menu");
479 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
480 const size_t nMarked = rMarkList.GetMarkCount();
482 mxPopupMenu->set_sensitive("url", false);
483 mxPopupMenu->set_sensitive("active", false);
484 mxPopupMenu->set_sensitive("macro", false);
485 mxPopupMenu->set_sensitive("selectall", pModel->GetPage(0)->GetObjCount() != pView->GetMarkedObjectCount());
487 if ( !nMarked )
489 mxPopupMenu->set_sensitive("arrange", false);
490 mxPopupMenu->set_sensitive("delete", false);
492 else
494 if ( nMarked == 1 )
496 SdrObject* pSdrObj = GetSelectedSdrObject();
498 mxPopupMenu->set_sensitive("url", true);
499 mxPopupMenu->set_sensitive("active", true);
500 mxPopupMenu->set_sensitive("macro", true);
501 mxPopupMenu->set_active("active", GetIMapObj(pSdrObj)->IsActive());
504 mxPopupMenu->set_sensitive("arrange", true);
505 mxPopupMenu->set_sensitive("delete", true);
508 MenuSelectHdl(mxPopupMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
510 mxPopupMenu.reset();
512 return true;
514 return CustomWidgetController::Command(rCEvt);
517 IMapDropTargetHelper::IMapDropTargetHelper(IMapWindow& rImapWindow)
518 : DropTargetHelper(rImapWindow.GetDrawingArea()->get_drop_target())
519 , m_rImapWindow(rImapWindow)
523 sal_Int8 IMapDropTargetHelper::AcceptDrop( const AcceptDropEvent& rEvt )
525 return m_rImapWindow.AcceptDrop(rEvt);
528 sal_Int8 IMapDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
530 return m_rImapWindow.ExecuteDrop(rEvt);
533 sal_Int8 IMapWindow::AcceptDrop( const AcceptDropEvent& rEvt )
535 return( ( GetHitSdrObj( rEvt.maPosPixel ) != nullptr ) ? rEvt.mnAction : DND_ACTION_NONE );
538 sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
540 sal_Int8 nRet = DND_ACTION_NONE;
542 if (mxDropTargetHelper->IsDropFormatSupported(SotClipboardFormatId::NETSCAPE_BOOKMARK))
544 INetBookmark aBookMark( "", "" );
545 SdrObject* pSdrObj = GetHitSdrObj( rEvt.maPosPixel );
547 if( pSdrObj && TransferableDataHelper( rEvt.maDropEvent.Transferable ).GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aBookMark ) )
549 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
551 pIMapObj->SetURL( aBookMark.GetURL() );
552 pIMapObj->SetAltText( aBookMark.GetDescription() );
553 pModel->SetChanged();
554 pView->UnmarkAll();
555 pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
556 UpdateInfo( true );
557 nRet = rEvt.mnAction;
561 return nRet;
564 OUString IMapWindow::RequestHelp(tools::Rectangle& rHelpArea)
566 OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
568 Point aPos = rDevice.PixelToLogic(rHelpArea.TopLeft());
570 SdrPageView* pPageView = nullptr;
571 SdrObject* pSdrObj = pView->PickObj(aPos, pView->getHitTolLog(), pPageView);
572 if (pSdrObj)
574 const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
575 if ( pIMapObj )
577 OUString aStr = pIMapObj->GetURL();
578 if ( !aStr.isEmpty() )
580 rHelpArea = rDevice.LogicToPixel(tools::Rectangle( Point(), GetGraphicSize()));
581 return aStr;
586 return OUString();
589 void IMapWindow::SetCurrentObjState( bool bActive )
591 SdrObject* pObj = GetSelectedSdrObject();
593 if ( !pObj )
594 return;
596 SfxItemSet aSet( pModel->GetItemPool() );
598 GetIMapObj( pObj )->SetActive( bActive );
600 aSet.Put( XFillColorItem( "", TRANSCOL ) );
602 if ( !bActive )
604 aSet.Put( XFillTransparenceItem( 100 ) );
605 aSet.Put( XLineColorItem( "", COL_RED ) );
607 else
609 aSet.Put( XFillTransparenceItem( 50 ) );
610 aSet.Put( XLineColorItem( "", COL_BLACK ) );
613 pView->SetAttributes( aSet );
616 void IMapWindow::UpdateInfo( bool bNewObj )
618 if ( !aInfoLink.IsSet() )
619 return;
621 const SdrObject* pSdrObj = GetSelectedSdrObject();
622 const IMapObject* pIMapObj = pSdrObj ? GetIMapObj( pSdrObj ) : nullptr;
624 aInfo.bNewObj = bNewObj;
626 if ( pIMapObj )
628 aInfo.bOneMarked = true;
629 aInfo.aMarkURL = pIMapObj->GetURL();
630 aInfo.aMarkAltText = pIMapObj->GetAltText();
631 aInfo.aMarkTarget = pIMapObj->GetTarget();
632 aInfo.bActivated = pIMapObj->IsActive();
633 aInfoLink.Call( *this );
635 else
637 aInfo.aMarkURL.clear();
638 aInfo.aMarkAltText.clear();
639 aInfo.aMarkTarget.clear();
640 aInfo.bOneMarked = false;
641 aInfo.bActivated = false;
644 aInfoLink.Call( *this );
647 void IMapWindow::DoMacroAssign()
649 SdrObject* pSdrObj = GetSelectedSdrObject();
651 if ( !pSdrObj )
652 return;
654 SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>
655 aSet(*pIMapPool);
657 SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
658 aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver );
659 aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut );
660 aSet.Put( aNamesItem );
662 SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
663 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
664 aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
665 aSet.Put( aMacroItem );
667 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
668 ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog(GetDrawingArea(), aSet, mxDocumentFrame));
670 if ( pMacroDlg->Execute() == RET_OK )
672 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
673 pIMapObj->SetMacroTable( pOutSet->Get( SID_ATTR_MACROITEM ).GetMacroTable() );
674 pModel->SetChanged();
675 UpdateInfo( false );
679 void IMapWindow::DoPropertyDialog()
681 SdrObject* pSdrObj = GetSelectedSdrObject();
683 if ( !pSdrObj )
684 return;
686 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
687 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
688 ScopedVclPtr<AbstractURLDlg> aDlg(pFact->CreateURLDialog(GetDrawingArea(), pIMapObj->GetURL(), pIMapObj->GetAltText(), pIMapObj->GetDesc(),
689 pIMapObj->GetTarget(), pIMapObj->GetName(), aTargetList));
690 if ( aDlg->Execute() != RET_OK )
691 return;
693 const OUString aURLText( aDlg->GetURL() );
695 if ( !aURLText.isEmpty() )
697 INetURLObject aObj( aURLText, INetProtocol::File );
698 DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid URL" );
699 pIMapObj->SetURL( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
701 else
702 pIMapObj->SetURL( aURLText );
704 pIMapObj->SetAltText( aDlg->GetAltText() );
705 pIMapObj->SetDesc( aDlg->GetDesc() );
706 pIMapObj->SetTarget( aDlg->GetTarget() );
707 pIMapObj->SetName( aDlg->GetName() );
708 pModel->SetChanged();
709 UpdateInfo( true );
712 void IMapWindow::MenuSelectHdl(const OUString& rId)
714 if (rId == "url")
715 DoPropertyDialog();
716 else if (rId == "macro")
717 DoMacroAssign();
718 else if (rId == "active")
720 const bool bNewState = !mxPopupMenu->get_active(rId);
721 SetCurrentObjState(bNewState);
722 UpdateInfo( false );
724 else if (rId == "front")
725 pView->PutMarkedToTop();
726 else if (rId == "forward")
727 pView->MovMarkedToTop();
728 else if (rId == "backward")
729 pView->MovMarkedToBtm();
730 else if (rId == "back")
731 pView->PutMarkedToBtm();
732 else if (rId == "selectall")
733 pView->MarkAll();
734 else if (rId == "delete")
735 pView->DeleteMarked();
738 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */