LibreOffice Module svx (master)  1
svdouno.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
22 #include <com/sun/star/container/XChild.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/util/XCloneable.hpp>
25 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <svx/svdouno.hxx>
28 #include <svx/svdpagv.hxx>
29 #include <svx/svdmodel.hxx>
30 #include <svx/dialmgr.hxx>
31 #include <svx/strings.hrc>
32 #include <svx/svdview.hxx>
33 #include <svx/svdorect.hxx>
34 #include <svx/svdviter.hxx>
35 #include <rtl/ustrbuf.hxx>
36 #include <rtl/ref.hxx>
37 #include <svx/sdrpagewindow.hxx>
38 #include <tools/diagnose_ex.h>
39 #include <tools/debug.hxx>
40 #include <o3tl/sorted_vector.hxx>
41 
42 using namespace ::com::sun::star;
43 using namespace sdr::contact;
44 
45 
46 // Defines
47 
48 
49 // Helper class SdrControlEventListenerImpl
50 
51 #include <com/sun/star/lang/XEventListener.hpp>
52 
53 #include <cppuhelper/implbase.hxx>
54 
55 
56 class SdrControlEventListenerImpl : public ::cppu::WeakImplHelper< css::lang::XEventListener >
57 {
58 protected:
60 
61 public:
63  : pObj(_pObj)
64  {}
65 
66  // XEventListener
67  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
68 
69  void StopListening(const uno::Reference< lang::XComponent >& xComp);
70  void StartListening(const uno::Reference< lang::XComponent >& xComp);
71 };
72 
73 // XEventListener
74 void SAL_CALL SdrControlEventListenerImpl::disposing( const css::lang::EventObject& /*Source*/)
75 {
76  if (pObj)
77  {
78  pObj->xUnoControlModel = nullptr;
79  }
80 }
81 
82 void SdrControlEventListenerImpl::StopListening(const uno::Reference< lang::XComponent >& xComp)
83 {
84  if (xComp.is())
85  xComp->removeEventListener(this);
86 }
87 
88 void SdrControlEventListenerImpl::StartListening(const uno::Reference< lang::XComponent >& xComp)
89 {
90  if (xComp.is())
91  xComp->addEventListener(this);
92 }
93 
94 
96 {
97  mutable ::rtl::Reference< SdrControlEventListenerImpl >
99 };
100 
101 
102 namespace
103 {
104  void lcl_ensureControlVisibility( SdrView const * _pView, const SdrUnoObj* _pObject, bool _bVisible )
105  {
106  OSL_PRECOND( _pObject, "lcl_ensureControlVisibility: no object -> no survival!" );
107 
108  SdrPageView* pPageView = _pView ? _pView->GetSdrPageView() : nullptr;
109  DBG_ASSERT( pPageView, "lcl_ensureControlVisibility: no view found!" );
110  if ( !pPageView )
111  return;
112 
113  ViewContact& rUnoControlContact( _pObject->GetViewContact() );
114 
115  for ( sal_uInt32 i = 0; i < pPageView->PageWindowCount(); ++i )
116  {
117  SdrPageWindow* pPageWindow = pPageView->GetPageWindow( i );
118  DBG_ASSERT( pPageWindow, "lcl_ensureControlVisibility: invalid PageViewWindow!" );
119  if ( !pPageWindow )
120  continue;
121 
122  if ( !pPageWindow->HasObjectContact() )
123  continue;
124 
125  ObjectContact& rPageViewContact( pPageWindow->GetObjectContact() );
126  const ViewObjectContact& rViewObjectContact( rUnoControlContact.GetViewObjectContact( rPageViewContact ) );
127  const ViewObjectContactOfUnoControl* pUnoControlContact = dynamic_cast< const ViewObjectContactOfUnoControl* >( &rViewObjectContact );
128  DBG_ASSERT( pUnoControlContact, "lcl_ensureControlVisibility: wrong ViewObjectContact type!" );
129  if ( !pUnoControlContact )
130  continue;
131 
132  pUnoControlContact->ensureControlVisibility( _bVisible );
133  }
134  }
135 }
136 
138  SdrModel& rSdrModel,
139  const OUString& rModelName)
140 : SdrRectObj(rSdrModel),
142 {
143  m_bIsUnoObj = true;
144 
145  m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
146 
147  // only an owner may create independently
148  if (!rModelName.isEmpty())
149  CreateUnoControlModel(rModelName);
150 }
151 
152 SdrUnoObj::SdrUnoObj( SdrModel& rSdrModel, SdrUnoObj const & rSource)
153 : SdrRectObj(rSdrModel, rSource),
155 {
156  m_bIsUnoObj = true;
157 
158  m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
159 
162 
163  // copy the uno control model
164  const uno::Reference< awt::XControlModel > xSourceControlModel = rSource.GetUnoControlModel();
165  if ( xSourceControlModel.is() )
166  {
167  try
168  {
169  uno::Reference< util::XCloneable > xClone( xSourceControlModel, uno::UNO_QUERY_THROW );
170  xUnoControlModel.set( xClone->createClone(), uno::UNO_QUERY_THROW );
171  }
172  catch( const uno::Exception& )
173  {
175  }
176  }
177 
178  // get service name of the control from the control model
179  uno::Reference< beans::XPropertySet > xSet(xUnoControlModel, uno::UNO_QUERY);
180  if (xSet.is())
181  {
182  uno::Any aValue( xSet->getPropertyValue("DefaultControl") );
183  OUString aStr;
184 
185  if( aValue >>= aStr )
186  aUnoControlTypeName = aStr;
187  }
188 
189  uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
190  if (xComp.is())
191  m_pImpl->pEventListener->StartListening(xComp);
192 }
193 
195  SdrModel& rSdrModel,
196  const OUString& rModelName,
197  const uno::Reference< lang::XMultiServiceFactory >& rxSFac)
198 : SdrRectObj(rSdrModel),
200 {
201  m_bIsUnoObj = true;
202 
203  m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
204 
205  // only an owner may create independently
206  if (!rModelName.isEmpty())
207  CreateUnoControlModel(rModelName,rxSFac);
208 }
209 
211 {
212  try
213  {
214  // clean up the control model
215  uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
216  if (xComp.is())
217  {
218  // is the control model owned by its environment?
219  uno::Reference< container::XChild > xContent(xUnoControlModel, uno::UNO_QUERY);
220  if (xContent.is() && !xContent->getParent().is())
221  xComp->dispose();
222  else
223  m_pImpl->pEventListener->StopListening(xComp);
224  }
225  }
226  catch( const uno::Exception& )
227  {
228  TOOLS_WARN_EXCEPTION( "svx", "SdrUnoObj::~SdrUnoObj" );
229  }
230 }
231 
233 {
234  rInfo.bRotateFreeAllowed = false;
235  rInfo.bRotate90Allowed = false;
236  rInfo.bMirrorFreeAllowed = false;
237  rInfo.bMirror45Allowed = false;
238  rInfo.bMirror90Allowed = false;
239  rInfo.bTransparenceAllowed = false;
240  rInfo.bShearAllowed = false;
241  rInfo.bEdgeRadiusAllowed = false;
242  rInfo.bNoOrthoDesired = false;
243  rInfo.bCanConvToPath = false;
244  rInfo.bCanConvToPoly = false;
245  rInfo.bCanConvToPathLineToArea = false;
246  rInfo.bCanConvToPolyLineToArea = false;
247  rInfo.bCanConvToContour = false;
248 }
249 
251 {
252  return OBJ_UNO;
253 }
254 
255 void SdrUnoObj::SetContextWritingMode( const sal_Int16 _nContextWritingMode )
256 {
257  try
258  {
259  uno::Reference< beans::XPropertySet > xModelProperties( GetUnoControlModel(), uno::UNO_QUERY_THROW );
260  xModelProperties->setPropertyValue( "ContextWritingMode", uno::makeAny( _nContextWritingMode ) );
261  }
262  catch( const uno::Exception& )
263  {
265  }
266 }
267 
269 {
270  OUString sName(SvxResId(STR_ObjNameSingulUno));
271 
272  OUString aName(GetName());
273  if (!aName.isEmpty())
274  sName += " '" + aName + "'";
275 
276  return sName;
277 }
278 
280 {
281  return SvxResId(STR_ObjNamePluralUno);
282 }
283 
285 {
286  return new SdrUnoObj(rTargetModel, *this);
287 }
288 
289 void SdrUnoObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
290 {
291  SdrRectObj::NbcResize(rRef,xFact,yFact);
292 
293  if (maGeo.nShearAngle==0_deg100 && maGeo.nRotationAngle==0_deg100)
294  return;
295 
296  // small correctors
297  if (maGeo.nRotationAngle>=9000_deg100 && maGeo.nRotationAngle<27000_deg100)
298  {
300  }
301 
302  maGeo.nRotationAngle = 0_deg100;
303  maGeo.nShearAngle = 0_deg100;
306  maGeo.mfTanShearAngle = 0.0;
307  SetRectsDirty();
308 }
309 
310 
312 {
313  // no special drag; we have no rounding rect and
314  // do want frame handles
315  return false;
316 }
317 
319 {
320  if ( GetLayer() == _nLayer )
321  { // redundant call -> not interested in doing anything here
322  SdrRectObj::NbcSetLayer( _nLayer );
323  return;
324  }
325 
326  // we need some special handling here in case we're moved from an invisible layer
327  // to a visible one, or vice versa
328  // (relative to a layer. Remember that the visibility of a layer is a view attribute
329  // - the same layer can be visible in one view, and invisible in another view, at the
330  // same time)
331 
332  // collect all views in which our old layer is visible
333  o3tl::sorted_vector< SdrView* > aPreviouslyVisible;
334 
335  {
336  SdrViewIter aIter( this );
337  for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
338  aPreviouslyVisible.insert( pView );
339  }
340 
341  SdrRectObj::NbcSetLayer( _nLayer );
342 
343  // collect all views in which our new layer is visible
344  o3tl::sorted_vector< SdrView* > aNewlyVisible;
345 
346  {
347  SdrViewIter aIter( this );
348  for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
349  {
350  if ( aPreviouslyVisible.erase(pView) == 0 )
351  {
352  // in pView, we were visible _before_ the layer change, and are
353  // _not_ visible after the layer change
354  // => remember this view, as our visibility there changed
355  aNewlyVisible.insert( pView );
356  }
357  }
358  }
359 
360  // now aPreviouslyVisible contains all views where we became invisible
361  for (const auto& rpView : aPreviouslyVisible)
362  {
363  lcl_ensureControlVisibility( rpView, this, false );
364  }
365 
366  // and aNewlyVisible all views where we became visible
367  for (const auto& rpView : aNewlyVisible)
368  {
369  lcl_ensureControlVisibility( rpView, this, true );
370  }
371 }
372 
373 void SdrUnoObj::CreateUnoControlModel(const OUString& rModelName)
374 {
375  DBG_ASSERT(!xUnoControlModel.is(), "model already exists");
376 
377  aUnoControlModelTypeName = rModelName;
378 
379  uno::Reference< awt::XControlModel > xModel;
380  uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
381  if (!aUnoControlModelTypeName.isEmpty() )
382  {
383  xModel.set(xContext->getServiceManager()->createInstanceWithContext(
384  aUnoControlModelTypeName, xContext), uno::UNO_QUERY);
385 
386  if (xModel.is())
387  SetChanged();
388  }
389 
390  SetUnoControlModel(xModel);
391 }
392 
393 void SdrUnoObj::CreateUnoControlModel(const OUString& rModelName,
394  const uno::Reference< lang::XMultiServiceFactory >& rxSFac)
395 {
396  DBG_ASSERT(!xUnoControlModel.is(), "model already exists");
397 
398  aUnoControlModelTypeName = rModelName;
399 
400  uno::Reference< awt::XControlModel > xModel;
401  if (!aUnoControlModelTypeName.isEmpty() && rxSFac.is() )
402  {
403  xModel.set(rxSFac->createInstance(aUnoControlModelTypeName), uno::UNO_QUERY);
404 
405  if (xModel.is())
406  SetChanged();
407  }
408 
409  SetUnoControlModel(xModel);
410 }
411 
412 void SdrUnoObj::SetUnoControlModel( const uno::Reference< awt::XControlModel >& xModel)
413 {
414  if (xUnoControlModel.is())
415  {
416  uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
417  if (xComp.is())
418  m_pImpl->pEventListener->StopListening(xComp);
419  }
420 
421  xUnoControlModel = xModel;
422 
423  // control model has to contain service name of the control
424  if (xUnoControlModel.is())
425  {
426  uno::Reference< beans::XPropertySet > xSet(xUnoControlModel, uno::UNO_QUERY);
427  if (xSet.is())
428  {
429  uno::Any aValue( xSet->getPropertyValue("DefaultControl") );
430  OUString aStr;
431  if( aValue >>= aStr )
432  aUnoControlTypeName = aStr;
433  }
434 
435  uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
436  if (xComp.is())
437  m_pImpl->pEventListener->StartListening(xComp);
438  }
439 
440  // invalidate all ViewObject contacts
441  ViewContactOfUnoControl* pVC = nullptr;
442  if ( impl_getViewContact( pVC ) )
443  {
444  // flushViewObjectContacts() removes all existing VOCs for the local DrawHierarchy. This
445  // is always allowed since they will be re-created on demand (and with the changed model)
447  }
448 }
449 
450 
451 uno::Reference< awt::XControl > SdrUnoObj::GetUnoControl(const SdrView& _rView, const OutputDevice& _rOut) const
452 {
453  uno::Reference< awt::XControl > xControl;
454 
455  SdrPageView* pPageView = _rView.GetSdrPageView();
456  OSL_ENSURE( pPageView && getSdrPageFromSdrObject() == pPageView->GetPage(), "SdrUnoObj::GetUnoControl: This object is not displayed in that particular view!" );
457  if ( !pPageView || getSdrPageFromSdrObject() != pPageView->GetPage() )
458  return nullptr;
459 
460  SdrPageWindow* pPageWindow = pPageView->FindPageWindow( _rOut );
461  OSL_ENSURE( pPageWindow, "SdrUnoObj::GetUnoControl: did not find my SdrPageWindow!" );
462  if ( !pPageWindow )
463  return nullptr;
464 
465  ViewObjectContact& rViewObjectContact( GetViewContact().GetViewObjectContact( pPageWindow->GetObjectContact() ) );
466  ViewObjectContactOfUnoControl* pUnoContact = dynamic_cast< ViewObjectContactOfUnoControl* >( &rViewObjectContact );
467  OSL_ENSURE( pUnoContact, "SdrUnoObj::GetUnoControl: wrong contact type!" );
468  if ( pUnoContact )
469  xControl = pUnoContact->getControl();
470 
471  return xControl;
472 }
473 
474 
475 uno::Reference< awt::XControl > SdrUnoObj::GetTemporaryControlForWindow(
476  const vcl::Window& _rWindow, uno::Reference< awt::XControlContainer >& _inout_ControlContainer ) const
477 {
478  uno::Reference< awt::XControl > xControl;
479 
480  ViewContactOfUnoControl* pVC = nullptr;
481  if ( impl_getViewContact( pVC ) )
482  xControl = pVC->getTemporaryControlForWindow( _rWindow, _inout_ControlContainer );
483 
484  return xControl;
485 }
486 
487 
489 {
490  ViewContact& rViewContact( GetViewContact() );
491  _out_rpContact = dynamic_cast< ViewContactOfUnoControl* >( &rViewContact );
492  DBG_ASSERT( _out_rpContact, "SdrUnoObj::impl_getViewContact: could not find my ViewContact!" );
493  return ( _out_rpContact != nullptr );
494 }
495 
496 
497 std::unique_ptr<sdr::contact::ViewContact> SdrUnoObj::CreateObjectSpecificViewContact()
498 {
499  return std::make_unique<sdr::contact::ViewContactOfUnoControl>( *this );
500 }
501 
502 
503 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SVX_DLLPRIVATE bool impl_getViewContact(sdr::contact::ViewContactOfUnoControl *&_out_rpContact) const
Retrieves the typed ViewContact for the object.
Definition: svdouno.cxx:488
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: svdouno.cxx:74
css::uno::Reference< css::awt::XControl > getControl()
returns the ->XControl instance belonging to the instance, creates it if necessary ...
void StartListening(const uno::Reference< lang::XComponent > &xComp)
Definition: svdouno.cxx:88
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdouno.cxx:250
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdouno.cxx:232
css::uno::Reference< css::awt::XControl > getTemporaryControlForWindow(const vcl::Window &_rWindow, css::uno::Reference< css::awt::XControlContainer > &_inout_ControlContainer) const
retrieves a temporary XControl instance, whose parent is the given window SdrUnoObj::GetTemporaryCon...
double mfSinRotationAngle
Definition: svdtrans.hxx:219
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode) override
Definition: svdouno.cxx:255
SdrUnoObj(SdrModel &rSdrModel, const OUString &rModelName)
Definition: svdouno.cxx:137
SdrObjKind
Definition: svdobjkind.hxx:24
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:251
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:38
SdrView * NextView()
Definition: svdviter.cxx:158
SdrPageWindow * FindPageWindow(SdrPaintWindow &rPaintWindow) const
Definition: svdpagv.cxx:43
Provides information about various ZObject properties.
Definition: svdobj.hxx:194
virtual void NbcSetLayer(SdrLayerID nLayer) override
Definition: svdouno.cxx:318
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
Definition: svdpagv.cxx:83
tools::Long Left() const
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:269
bool m_bIsUnoObj
Definition: svdobj.hxx:898
SVX_DLLPRIVATE void CreateUnoControlModel(const OUString &rModelName)
Definition: svdouno.cxx:373
tools::Long Bottom() const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdouno.cxx:497
tools::Rectangle maRect
Definition: svdotext.hxx:170
virtual ~SdrUnoObj() override
Definition: svdouno.cxx:210
void StopListening(const uno::Reference< lang::XComponent > &xComp)
Definition: svdouno.cxx:82
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdouno.cxx:289
virtual OUString TakeObjNamePlural() const override
Definition: svdouno.cxx:279
double mfTanShearAngle
Definition: svdtrans.hxx:218
OUString aUnoControlTypeName
Definition: svdouno.hxx:51
#define DBG_UNHANDLED_EXCEPTION(...)
OUString SvxResId(std::string_view aId)
Definition: dialmgr.cxx:25
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_ASSERT(sCon, aError)
int i
OUString sName
friend class SdrControlEventListenerImpl
Definition: svdouno.hxx:46
css::uno::Reference< css::awt::XControl > GetTemporaryControlForWindow(const vcl::Window &_rWindow, css::uno::Reference< css::awt::XControlContainer > &_inout_ControlContainer) const
Retrieves a temporary XControl instance for a given output device.
Definition: svdouno.cxx:475
virtual void SetUnoControlModel(const css::uno::Reference< css::awt::XControlModel > &xModel)
Definition: svdouno.cxx:412
void flushViewObjectContacts(bool bWithHierarchy=true)
tools::Long Top() const
const sdr::contact::ObjectContact & GetObjectContact() const
OUString GetName() const
Definition: svdobj.cxx:804
virtual SdrLayerID GetLayer() const
Definition: svdobj.cxx:680
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdouno.cxx:311
SdrControlEventListenerImpl(SdrUnoObj *_pObj)
Definition: svdouno.cxx:62
mutable::rtl::Reference< SdrControlEventListenerImpl > pEventListener
Definition: svdouno.cxx:98
std::unique_ptr< SdrUnoObjDataHolder > m_pImpl
Definition: svdouno.hxx:48
SdrPage * GetPage() const
Definition: svdpagv.hxx:170
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:455
GeoStat maGeo
Definition: svdotext.hxx:173
Degree100 nRotationAngle
Definition: svdtrans.hxx:216
bool HasObjectContact() const
determines whether there already exists an ObjectContact
OUString aName
double mfCosRotationAngle
Definition: svdtrans.hxx:220
Reference< XComponentContext > getProcessComponentContext()
virtual OUString TakeObjNameSingul() const override
Definition: svdouno.cxx:268
css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView &_rView, const OutputDevice &_rOut) const
Definition: svdouno.cxx:451
SdrPageView * GetSdrPageView() const
Definition: svdpntv.hxx:299
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
Definition: svdobj.cxx:512
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
Definition: svdouno.hxx:91
uno::Reference< ucb::XContent > xContent
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
Reference< XModel > xModel
css::uno::Reference< css::awt::XControlModel > xUnoControlModel
Definition: svdouno.hxx:54
continuously activated OLE (PlugIn-Frame or similar)
Definition: svdobjkind.hxx:54
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
std::pair< const_iterator, bool > insert(Value &&x)
virtual void SetChanged()
Definition: svdobj.cxx:1035
virtual SdrUnoObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdouno.cxx:284
SdrView * FirstView()
Definition: svdviter.cxx:152
aStr
Degree100 nShearAngle
Definition: svdtrans.hxx:217
tools::Long Right() const
OUString aUnoControlModelTypeName
Definition: svdouno.hxx:50
size_type erase(const Value &x)
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:697
sal_uInt32 PageWindowCount() const
Definition: svdpagv.hxx:93