Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 97529

how to get rid of activeselectionobserver getting attached automatically on any new document?

$
0
0

I am attaching my ActiveSelectionObserver on a document on kAfterOpenDocSignalResponderService by pasing the docRef.

Please see below code:

 case kAfterOpenDocSignalResponderService:    {         InterfacePtr<IDocumentSignalData> documentSignalData(signalMgr, UseDefaultIID());         UIDRef docUIDRef = documentSignalData->GetDocument();      /*ActiveSelectionObserver: this will observe all the selection changes in the document  pageItems selected, text selected, deselected etc.*/        InterfacePtr<IObserver> selDocObserver(docUIDRef, IID_ICSDTSELECTIONOBSERVER);        if (selDocObserver != nil)        {            selDocObserver->AutoAttach();        }        break;    }

 

The observer is supposed to get attached on the event of opening a existing Doc, but once the observer is attached on the document then when I create a new doc, the observer gets attached on that

doc as well which want to restrict. I just want my Observer to respond only to the doc which I used to reference the Observer.

What shall I do?


Viewing all articles
Browse latest Browse all 97529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>