loplugin:methodcycles more graph theory for the win
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
0f2e01677c
commit
1534025a03
98
compilerplugins/clang/methodcycles.partition.results
Normal file
98
compilerplugins/clang/methodcycles.partition.results
Normal file
@ -0,0 +1,98 @@
|
||||
callDict size 32
|
||||
|
||||
|
||||
void writerfilter::ooxml::OOXMLFastContextHandler::setParent(writerfilter::ooxml::OOXMLFastContextHandler *)
|
||||
writerfilter/source/ooxml/OOXMLFastContextHandler.hxx:122
|
||||
|
||||
int SdrMarkView::GetMarkedPointCount() const
|
||||
include/svx/svdmrkv.hxx:314
|
||||
|
||||
void SvxTextForwarder::SetUpdateModeForAcc(bool)
|
||||
include/editeng/unoedsrc.hxx:218
|
||||
|
||||
bool psp::PrinterInfoManager::writePrinterConfig()
|
||||
vcl/inc/printerinfomanager.hxx:172
|
||||
|
||||
void sdr::overlay::OverlayManager::restoreBackground(const vcl::Region &) const
|
||||
include/svx/sdr/overlay/overlaymanager.hxx:107
|
||||
|
||||
bool psp::PrinterInfoManager::setDefaultPrinter(const rtl::OUString &)
|
||||
vcl/inc/printerinfomanager.hxx:176
|
||||
|
||||
SdrUndoAction * SdrUndoFactory::CreateUndoMoveLayer(unsigned short,SdrLayerAdmin &,SdrModel &,unsigned short)
|
||||
include/svx/svdundo.hxx:758
|
||||
|
||||
void writerfilter::dmapper::TableManager::cellPropsByCell(unsigned int,const tools::SvRef<writerfilter::dmapper::TablePropertyMap> &)
|
||||
writerfilter/source/dmapper/TableManager.hxx:452
|
||||
|
||||
double LwpVirtualLayout::GetColWidth(unsigned short)
|
||||
lotuswordpro/source/filter/lwplayout.hxx:102
|
||||
|
||||
double slideshow::internal::ShapeAttributeLayer::getCharRotationAngle() const
|
||||
slideshow/source/inc/shapeattributelayer.hxx:385
|
||||
|
||||
bool SwDrawBase::KeyInput(const KeyEvent &)
|
||||
sw/source/uibase/inc/drawbase.hxx:53
|
||||
|
||||
void SdrObject::ReformatText()
|
||||
include/svx/svdobj.hxx:685
|
||||
|
||||
void FormatterBase::SetLocale(const com::sun::star::lang::Locale &)
|
||||
include/vcl/field.hxx:78
|
||||
|
||||
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > writerfilter::ooxml::OOXMLFastContextHandler::getType() const
|
||||
writerfilter/source/ooxml/OOXMLFastContextHandler.hxx:88
|
||||
|
||||
bool sdr::contact::ObjectContact::isDrawModeBlackWhite() const
|
||||
include/svx/sdr/contact/objectcontact.hxx:154
|
||||
|
||||
void ScVbaCondition::setFormula1(const com::sun::star::uno::Any &)
|
||||
sc/source/ui/vba/vbacondition.hxx:42
|
||||
|
||||
void sax_fastparser::FastSaxSerializer::ForMerge::print()
|
||||
sax/source/tools/fastserializer.hxx:184
|
||||
|
||||
bool SvxTextForwarder::GetUpdateModeForAcc() const
|
||||
include/editeng/unoedsrc.hxx:219
|
||||
|
||||
rtl::OUString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec &) const
|
||||
include/svx/svdobj.hxx:695
|
||||
|
||||
bool psp::PrinterInfoManager::removePrinter(const rtl::OUString &,bool)
|
||||
vcl/inc/printerinfomanager.hxx:168
|
||||
|
||||
bool sdr::contact::ObjectContact::isOutputToWindow() const
|
||||
include/svx/sdr/contact/objectcontact.hxx:139
|
||||
|
||||
void SfxStyleSheetBase::Load(SvStream &,unsigned short)
|
||||
include/svl/style.hxx:135
|
||||
|
||||
void SfxObjectShell::PrepareReload()
|
||||
include/sfx2/objsh.hxx:440
|
||||
|
||||
void SfxObjectShell::InPlaceActivate(bool)
|
||||
include/sfx2/objsh.hxx:583
|
||||
|
||||
bool sdr::contact::ObjectContact::IsAreaVisible(const basegfx::B2DRange &) const
|
||||
include/svx/sdr/contact/objectcontact.hxx:116
|
||||
|
||||
void sfx2::sidebar::Deck::PrintWindowSubTree(vcl::Window *,int)
|
||||
include/sfx2/sidebar/Deck.hxx:70
|
||||
|
||||
void pdfi::PageElement::updateParagraphGeometry(pdfi::Element *)
|
||||
sdext/source/pdfimport/inc/genericelements.hxx:257
|
||||
|
||||
bool sdr::contact::ObjectContact::isOutputToVirtualDevice() const
|
||||
include/svx/sdr/contact/objectcontact.hxx:142
|
||||
|
||||
tools::Rectangle SvxViewForwarder::GetVisArea() const
|
||||
include/editeng/unoedsrc.hxx:470
|
||||
|
||||
bool psp::PrinterInfoManager::addPrinter(const rtl::OUString &,const rtl::OUString &)
|
||||
vcl/inc/printerinfomanager.hxx:161
|
||||
|
||||
SdrUndoAction * SdrUndoFactory::CreateUndoMoveObject(SdrObject &)
|
||||
include/svx/svdundo.hxx:733
|
||||
|
||||
SdrObject * SdrObjList::NbcReplaceObject(SdrObject *,unsigned long)
|
||||
include/svx/svdpage.hxx:126
|
@ -81,7 +81,7 @@ def sort_set_by_natural_key(s):
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
# follow caller-callee chains, removing all methods reachable from a root method
|
||||
def remove_reachable(startCaller):
|
||||
def remove_reachable(callDict, startCaller):
|
||||
worklist = list()
|
||||
worklist.append(startCaller)
|
||||
while len(worklist) > 0:
|
||||
@ -151,12 +151,18 @@ for caller in callDict:
|
||||
to_be_removed.add(caller)
|
||||
# remove everything reachable from the found entry points
|
||||
for caller in to_be_removed:
|
||||
remove_reachable(caller)
|
||||
remove_reachable(callDict, caller)
|
||||
for caller in callDict:
|
||||
callDict[caller] -= to_be_removed
|
||||
|
||||
# create a reverse call graph
|
||||
inverseCallDict = defaultdict(set) # map of from_method_name -> set(method_name)
|
||||
for caller in callDict:
|
||||
for callee in callDict[caller]:
|
||||
inverseCallDict[callee].add(caller)
|
||||
|
||||
print_tree_recurse_set = set() # protect against cycles
|
||||
def print_tree(f, caller, depth):
|
||||
def print_tree(f, callDict, caller, depth):
|
||||
if depth == 0:
|
||||
f.write("\n") # add an empty line before each tree
|
||||
print_tree_recurse_set.clear()
|
||||
@ -172,13 +178,7 @@ def print_tree(f, caller, depth):
|
||||
f.write(" " * depth + definitionToSourceLocationMap[caller] + "\n")
|
||||
calleeSet = callDict[caller]
|
||||
for c in calleeSet:
|
||||
print_tree(f, c, depth+1)
|
||||
|
||||
# create a reverse call graph
|
||||
inverseCallDict = defaultdict(set) # map of from_method_name -> set(method_name)
|
||||
for caller in callDict:
|
||||
for callee in callDict[caller]:
|
||||
inverseCallDict[callee].add(caller)
|
||||
print_tree(f, callDict, c, depth+1)
|
||||
|
||||
# find possible roots (ie. entrypoints) by looking for methods that are not called
|
||||
def dump_possible_roots():
|
||||
@ -201,10 +201,10 @@ def dump_possible_roots():
|
||||
count = count + 1
|
||||
#if count>1000: break
|
||||
|
||||
|
||||
# Look for cycles in a directed graph
|
||||
# Adapted from:
|
||||
# https://codereview.stackexchange.com/questions/86021/check-if-a-directed-graph-contains-a-cycle
|
||||
def print_cycles():
|
||||
with open("compilerplugins/clang/methodcycles.results", "wt") as f:
|
||||
path = set()
|
||||
visited = set()
|
||||
@ -240,3 +240,36 @@ with open("compilerplugins/clang/methodcycles.results", "wt") as f:
|
||||
|
||||
for caller in callDict:
|
||||
checkCyclic(caller)
|
||||
|
||||
print_cycles()
|
||||
|
||||
# print partioned sub-graphs
|
||||
def print_partitions():
|
||||
callDict2 = callDict
|
||||
# Remove anything with no callees, and that is itself not called.
|
||||
# After this stage, we should only be left with closed sub-graphs ie. partitions
|
||||
while True:
|
||||
to_be_removed.clear()
|
||||
for caller in callDict2:
|
||||
if len(callDict2[caller]) == 0 \
|
||||
or not caller in inverseCallDict[caller]:
|
||||
to_be_removed.add(caller)
|
||||
if len(to_be_removed) == 0:
|
||||
break
|
||||
for caller in to_be_removed:
|
||||
remove_reachable(callDict2, caller)
|
||||
for caller in callDict2:
|
||||
callDict2[caller] -= to_be_removed
|
||||
|
||||
count = 0
|
||||
with open("compilerplugins/clang/methodcycles.partition.results", "wt") as f:
|
||||
f.write("callDict size " + str(len(callDict2)) + "\n")
|
||||
f.write("\n")
|
||||
while len(callDict2) > 0:
|
||||
print_tree(f, callDict2, next(iter(callDict2)), 0)
|
||||
for c in print_tree_recurse_set:
|
||||
callDict2.pop(c, None)
|
||||
count = count + 1
|
||||
if count>1000: break
|
||||
|
||||
print_partitions()
|
@ -1,10 +1,3 @@
|
||||
found cycle
|
||||
bool connectivity::OSQLParseTreeIterator::impl_getColumnTableRange(const connectivity::OSQLParseNode *,rtl::OUString &) const
|
||||
include/connectivity/sqliterator.hxx:272
|
||||
|
||||
bool connectivity::OSQLParseTreeIterator::getColumnTableRange(const connectivity::OSQLParseNode *,rtl::OUString &) const
|
||||
include/connectivity/sqliterator.hxx:259
|
||||
|
||||
found cycle
|
||||
void (anonymous namespace)::traceValue(_typelib_TypeDescriptionReference *,void *)
|
||||
cppu/source/LogBridge/LogBridge.cxx:132
|
||||
@ -15,40 +8,16 @@ found cycle
|
||||
void LogProbe(bool,void *,void *,_typelib_TypeDescriptionReference *,_typelib_MethodParameter *,int,const _typelib_TypeDescription *,void *,void **,_uno_Any **)
|
||||
cppu/source/LogBridge/LogBridge.cxx:192
|
||||
|
||||
found cycle
|
||||
rtl::OUString lcl_dbg_out(SwNodes &)
|
||||
sw/source/core/doc/dbgoutsw.cxx:743
|
||||
|
||||
void lcl_dbg_nodes_inner(rtl::OUString &,SwNodes &,unsigned long &)
|
||||
sw/source/core/doc/dbgoutsw.cxx:694
|
||||
|
||||
const char * dbg_out(SwNodes &)
|
||||
sw/inc/dbgoutsw.hxx:67
|
||||
|
||||
found cycle
|
||||
void OutputDevice::DrawPixel(const tools::Polygon &,const Color &)
|
||||
include/vcl/outdev.hxx:710
|
||||
|
||||
void OutputDevice::DrawPixel(const tools::Polygon &,const Color *)
|
||||
include/vcl/outdev.hxx:709
|
||||
|
||||
found cycle
|
||||
void SbxVariable::Dump(SvStream &,bool)
|
||||
include/basic/sbxvar.hxx:260
|
||||
|
||||
void SbxObject::Dump(SvStream &,bool)
|
||||
include/basic/sbxobj.hxx:81
|
||||
include/basic/sbxobj.hxx:80
|
||||
|
||||
void SbRtl_DumpAllObjects(StarBASIC *,SbxArray &,bool)
|
||||
basic/source/inc/rtlproto.hxx:293
|
||||
|
||||
found cycle
|
||||
SbxVariable * SbxArray::FindUserData(unsigned int)
|
||||
include/basic/sbx.hxx:138
|
||||
|
||||
SbxVariable * SbxObject::FindUserData(unsigned int)
|
||||
include/basic/sbxobj.hxx:60
|
||||
|
||||
found cycle
|
||||
unsigned long slideshow::internal::hash::operator()(const type-parameter-?-? &) const
|
||||
slideshow/source/inc/tools.hxx:83
|
||||
|
@ -679,16 +679,6 @@ EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_Int32 nPara ) const
|
||||
return mpTextForwarder->GetBulletInfo( nPara );
|
||||
}
|
||||
|
||||
void SvxAccessibleTextAdapter::SetUpdateModeForAcc(bool bUp)
|
||||
{
|
||||
return mpTextForwarder->SetUpdateModeForAcc(bUp);
|
||||
}
|
||||
|
||||
bool SvxAccessibleTextAdapter::GetUpdateModeForAcc( ) const
|
||||
{
|
||||
return mpTextForwarder->GetUpdateModeForAcc();
|
||||
}
|
||||
|
||||
tools::Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
|
||||
{
|
||||
assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder");
|
||||
@ -1125,13 +1115,6 @@ bool SvxAccessibleTextEditViewAdapter::IsValid() const
|
||||
return false;
|
||||
}
|
||||
|
||||
tools::Rectangle SvxAccessibleTextEditViewAdapter::GetVisArea() const
|
||||
{
|
||||
DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
|
||||
|
||||
return mpViewForwarder->GetVisArea();
|
||||
}
|
||||
|
||||
Point SvxAccessibleTextEditViewAdapter::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
DBG_ASSERT(mpViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder");
|
||||
|
@ -51,34 +51,6 @@ bool SvxDrawOutlinerViewForwarder::IsValid() const
|
||||
return true;
|
||||
}
|
||||
|
||||
tools::Rectangle SvxDrawOutlinerViewForwarder::GetVisArea() const
|
||||
{
|
||||
OutputDevice* pOutDev = mrOutlinerView.GetWindow();
|
||||
|
||||
if( pOutDev )
|
||||
{
|
||||
tools::Rectangle aVisArea = mrOutlinerView.GetVisArea();
|
||||
|
||||
Point aTextOffset( GetTextOffset() );
|
||||
aVisArea.Move( aTextOffset.X(), aTextOffset.Y() );
|
||||
|
||||
// figure out map mode from edit engine
|
||||
Outliner* pOutliner = mrOutlinerView.GetOutliner();
|
||||
|
||||
if( pOutliner )
|
||||
{
|
||||
MapMode aMapMode(pOutDev->GetMapMode());
|
||||
aVisArea = OutputDevice::LogicToLogic( aVisArea,
|
||||
pOutliner->GetRefMapMode(),
|
||||
MapMode(aMapMode.GetMapUnit()));
|
||||
aMapMode.SetOrigin(Point());
|
||||
return pOutDev->LogicToPixel( aVisArea, aMapMode );
|
||||
}
|
||||
}
|
||||
|
||||
return tools::Rectangle();
|
||||
}
|
||||
|
||||
Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
OutputDevice* pOutDev = mrOutlinerView.GetWindow();
|
||||
|
@ -72,8 +72,6 @@ public:
|
||||
virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const override;
|
||||
virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const override;
|
||||
virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const override;
|
||||
virtual void SetUpdateModeForAcc( bool bUp) override;
|
||||
virtual bool GetUpdateModeForAcc() const override;
|
||||
virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const override;
|
||||
virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const override;
|
||||
|
||||
@ -118,7 +116,6 @@ public:
|
||||
|
||||
// SvxViewForwarder interface
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
|
@ -215,9 +215,6 @@ public:
|
||||
*/
|
||||
virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const = 0;
|
||||
|
||||
virtual void SetUpdateModeForAcc(bool) {}
|
||||
virtual bool GetUpdateModeForAcc() const { return true; }
|
||||
|
||||
/** Query the bounding rectangle of the given character
|
||||
|
||||
@param nPara[0 .. n]
|
||||
@ -460,15 +457,6 @@ public:
|
||||
*/
|
||||
virtual bool IsValid() const = 0;
|
||||
|
||||
/** Query visible area of the view containing the text
|
||||
|
||||
@return the visible rectangle of the text, i.e. the part of
|
||||
the EditEngine or Outliner that is currently on screen. The
|
||||
values are already in screen coordinates (pixel), and have to
|
||||
be relative to the EditEngine/Outliner's upper left corner.
|
||||
*/
|
||||
virtual tools::Rectangle GetVisArea() const = 0;
|
||||
|
||||
/** Convert from logical, EditEngine-relative coordinates to screen coordinates
|
||||
|
||||
@param rPoint
|
||||
|
@ -41,7 +41,6 @@ public:
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
|
@ -437,7 +437,6 @@ public:
|
||||
|
||||
Size GetFirstPageSize();
|
||||
bool DoClose();
|
||||
virtual void PrepareReload();
|
||||
std::shared_ptr<GDIMetaFile> GetPreviewMetaFile( bool bFullContent = false ) const;
|
||||
virtual void CancelTransfers();
|
||||
|
||||
@ -580,7 +579,6 @@ public:
|
||||
static OUString GetServiceNameFromFactory( const OUString& rFact );
|
||||
bool IsInPlaceActive();
|
||||
bool IsUIActive();
|
||||
virtual void InPlaceActivate( bool );
|
||||
|
||||
static bool CopyStoragesOfUnknownMediaType(
|
||||
const css::uno::Reference< css::embed::XStorage >& xSource,
|
||||
|
@ -132,7 +132,6 @@ protected:
|
||||
SfxStyleSheetBase( const OUString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, SfxStyleSearchBits mask );
|
||||
SfxStyleSheetBase( const SfxStyleSheetBase& );
|
||||
virtual ~SfxStyleSheetBase() override;
|
||||
virtual void Load( SvStream&, sal_uInt16 );
|
||||
|
||||
public:
|
||||
|
||||
|
@ -112,9 +112,6 @@ public:
|
||||
// this ObjectContact. Default does nothing.
|
||||
virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
|
||||
|
||||
// Get info if given Rectangle is visible in this view
|
||||
virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const;
|
||||
|
||||
// Get info about the need to visualize GluePoints. The default
|
||||
// is that it is not necessary.
|
||||
virtual bool AreGluePointsVisible() const;
|
||||
@ -135,12 +132,6 @@ public:
|
||||
// print? Default is false
|
||||
virtual bool isOutputToPrinter() const;
|
||||
|
||||
// window? Default is true
|
||||
virtual bool isOutputToWindow() const;
|
||||
|
||||
// VirtualDevice? Default is false
|
||||
virtual bool isOutputToVirtualDevice() const;
|
||||
|
||||
// recording MetaFile? Default is false
|
||||
virtual bool isOutputToRecordingMetaFile() const;
|
||||
|
||||
@ -150,9 +141,6 @@ public:
|
||||
// gray display mode
|
||||
virtual bool isDrawModeGray() const;
|
||||
|
||||
// gray display mode
|
||||
virtual bool isDrawModeBlackWhite() const;
|
||||
|
||||
// high contrast display mode
|
||||
virtual bool isDrawModeHighContrast() const;
|
||||
|
||||
|
@ -71,9 +71,6 @@ public:
|
||||
// Process the whole displaying
|
||||
virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) override;
|
||||
|
||||
// VirtualDevice? Default is false
|
||||
virtual bool isOutputToVirtualDevice() const override;
|
||||
|
||||
// recording MetaFile? Default is false
|
||||
virtual bool isOutputToRecordingMetaFile() const override;
|
||||
|
||||
|
@ -103,9 +103,6 @@ namespace sdr
|
||||
// flush. Do buffered updates.
|
||||
virtual void flush();
|
||||
|
||||
// restore part of background. Implemented form buffered versions only.
|
||||
virtual void restoreBackground(const vcl::Region& rRegion) const;
|
||||
|
||||
// get the OutputDevice
|
||||
OutputDevice& getOutputDevice() const { return mrOutputDevice; }
|
||||
|
||||
|
@ -311,7 +311,6 @@ public:
|
||||
virtual bool HasMarkablePoints() const;
|
||||
virtual sal_Int32 GetMarkablePointCount() const;
|
||||
virtual bool HasMarkedPoints() const;
|
||||
virtual sal_Int32 GetMarkedPointCount() const;
|
||||
|
||||
// There might be points which can't be marked:
|
||||
virtual bool IsPointMarkable(const SdrHdl& rHdl) const;
|
||||
|
@ -682,7 +682,6 @@ public:
|
||||
virtual void NbcSetOutlinerParaObject(std::unique_ptr<OutlinerParaObject> pTextObject);
|
||||
virtual OutlinerParaObject* GetOutlinerParaObject() const;
|
||||
virtual void NbcReformatText();
|
||||
virtual void ReformatText();
|
||||
|
||||
void BurnInStyleSheetAttributes();
|
||||
|
||||
@ -692,7 +691,6 @@ public:
|
||||
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
|
||||
virtual void PaintMacro (OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
|
||||
virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
|
||||
virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
|
||||
bool IsMacroHit(const SdrObjMacroHitRec& rRec) const;
|
||||
|
||||
// Connectors
|
||||
|
@ -103,7 +103,6 @@ public:
|
||||
virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
|
||||
|
||||
virtual void NbcReformatText() override;
|
||||
virtual void ReformatText() override;
|
||||
|
||||
virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
|
||||
|
||||
|
@ -241,7 +241,6 @@ public:
|
||||
virtual OutlinerParaObject* GetOutlinerParaObject() const override;
|
||||
|
||||
virtual void NbcReformatText() override;
|
||||
virtual void ReformatText() override;
|
||||
|
||||
virtual bool IsVerticalWriting() const override;
|
||||
virtual void SetVerticalWriting(bool bVertical) override;
|
||||
|
@ -493,7 +493,6 @@ public:
|
||||
std::unique_ptr<OutlinerParaObject> GetEditOutlinerParaObject() const;
|
||||
|
||||
virtual void NbcReformatText() override;
|
||||
virtual void ReformatText() override;
|
||||
|
||||
virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
|
||||
bool bEdit, boost::optional<Color>& rpTxtColor, boost::optional<Color>& rpFldColor, OUString& rRet) const;
|
||||
|
@ -134,14 +134,12 @@ public:
|
||||
virtual void SetGeoData(const SdrObjGeoData& rGeo) override;
|
||||
|
||||
virtual void NbcReformatText() override;
|
||||
virtual void ReformatText() override;
|
||||
|
||||
virtual bool HasMacro() const override;
|
||||
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const override;
|
||||
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const override;
|
||||
virtual void PaintMacro (OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const override;
|
||||
virtual bool DoMacro (const SdrObjMacroHitRec& rRec) override;
|
||||
virtual OUString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const override;
|
||||
|
||||
// #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0)
|
||||
virtual const Point GetOffset() const;
|
||||
|
@ -123,7 +123,6 @@ public:
|
||||
/// Replace existing object by different one.
|
||||
/// Same as Remove(old)+Insert(new) but faster because the order numbers
|
||||
/// do not have to be set dirty.
|
||||
virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, size_t nObjNum);
|
||||
virtual SdrObject* ReplaceObject(SdrObject* pNewObj, size_t nObjNum);
|
||||
|
||||
/// Modify ZOrder of an SdrObject
|
||||
|
@ -730,7 +730,6 @@ class SVX_DLLPUBLIC SdrUndoFactory
|
||||
public:
|
||||
// Shapes
|
||||
virtual ~SdrUndoFactory();
|
||||
virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
|
||||
virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist );
|
||||
virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
|
||||
virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
|
||||
@ -755,7 +754,6 @@ public:
|
||||
// Layer
|
||||
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
|
||||
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
|
||||
virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNewPos1);
|
||||
|
||||
// Page
|
||||
virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
|
||||
|
@ -73,7 +73,6 @@ public:
|
||||
|
||||
// the SvxViewForwarder interface
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point&, const MapMode& ) const override;
|
||||
virtual Point PixelToLogic( const Point&, const MapMode& ) const override;
|
||||
|
||||
|
@ -75,7 +75,6 @@ public:
|
||||
virtual void Reformat();
|
||||
virtual void ReformatAll();
|
||||
|
||||
virtual void SetLocale( const css::lang::Locale& rLocale );
|
||||
const css::lang::Locale& GetLocale() const;
|
||||
const LanguageTag& GetLanguageTag() const;
|
||||
|
||||
@ -313,9 +312,6 @@ public:
|
||||
virtual void Reformat() override;
|
||||
virtual void ReformatAll() override;
|
||||
|
||||
virtual void SetLocale( const css::lang::Locale& rLocale ) override;
|
||||
|
||||
|
||||
void SetExtDateFormat( ExtDateFieldFormat eFormat );
|
||||
ExtDateFieldFormat GetExtDateFormat( bool bResolveSystemFormat = false ) const;
|
||||
|
||||
|
@ -122,17 +122,6 @@ bool LwpVirtualLayout::MarginsSameAsParent()
|
||||
return (m_nAttributes2 & STYLE2_MARGINSSAMEASPARENT) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @descr: Get column width
|
||||
*
|
||||
*/
|
||||
double LwpVirtualLayout::GetColWidth(sal_uInt16 /*nIndex*/)
|
||||
{
|
||||
//return GetContentWidth(); //not support now
|
||||
//return LwpTools::ConvertToMetric(5); //test
|
||||
return 0; //test
|
||||
}
|
||||
|
||||
/**
|
||||
* @descr: Get the gap between columns
|
||||
*
|
||||
@ -1557,31 +1546,6 @@ sal_uInt16 LwpLayout::GetNumCols()
|
||||
return nRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @descr: Get column width
|
||||
* @param: the order of column
|
||||
*/
|
||||
double LwpLayout::GetColWidth(sal_uInt16 nIndex)
|
||||
{
|
||||
if((m_nOverrideFlag & OVER_COLUMNS)||(m_nAttributes2 & STYLE2_LOCALCOLUMNINFO))
|
||||
{
|
||||
LwpLayoutColumns* pLayColumns = dynamic_cast<LwpLayoutColumns*>(m_LayColumns.obj().get());
|
||||
if(pLayColumns)
|
||||
{
|
||||
return pLayColumns->GetColWidth(nIndex);
|
||||
}
|
||||
}
|
||||
|
||||
rtl::Reference<LwpObject> xBase(GetBasedOnStyle());
|
||||
LwpVirtualLayout* pStyle = dynamic_cast<LwpVirtualLayout*>(xBase.get());
|
||||
if (pStyle)
|
||||
{
|
||||
return pStyle->GetColWidth(nIndex);
|
||||
}
|
||||
|
||||
return LwpVirtualLayout::GetColWidth(nIndex);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @descr: Get gap between columns
|
||||
|
@ -99,7 +99,6 @@ class LwpVirtualLayout : public LwpDLNFPVList
|
||||
public:
|
||||
LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
|
||||
virtual sal_uInt16 GetNumCols(){return 1;}
|
||||
virtual double GetColWidth(sal_uInt16 nIndex);
|
||||
virtual double GetColGap(sal_uInt16 nIndex);
|
||||
virtual bool IsAutoGrow(){ return false;}
|
||||
virtual bool IsAutoGrowUp(){ return false;}
|
||||
@ -445,7 +444,6 @@ protected:
|
||||
public:
|
||||
LwpUseWhen* VirtualGetUseWhen() override;
|
||||
virtual sal_uInt16 GetNumCols() override;
|
||||
virtual double GetColWidth(sal_uInt16 nIndex) override;
|
||||
virtual double GetColGap(sal_uInt16 nIndex) override;
|
||||
sal_uInt16 GetUsePage();
|
||||
public:
|
||||
|
@ -35,7 +35,6 @@ namespace rptui
|
||||
virtual ~OReportUndoFactory() override;
|
||||
|
||||
// shapes
|
||||
virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject ) override;
|
||||
virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist ) override;
|
||||
virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject ) override;
|
||||
virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false ) override;
|
||||
@ -54,7 +53,6 @@ namespace rptui
|
||||
// layer
|
||||
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) override;
|
||||
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) override;
|
||||
virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNewPos1) override;
|
||||
|
||||
// page
|
||||
virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage) override;
|
||||
|
@ -50,12 +50,6 @@ OReportUndoFactory::~OReportUndoFactory()
|
||||
{
|
||||
}
|
||||
|
||||
// shapes
|
||||
SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
|
||||
{
|
||||
return m_pUndoFactory->CreateUndoMoveObject( rObject );
|
||||
}
|
||||
|
||||
SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
|
||||
{
|
||||
return m_pUndoFactory->CreateUndoMoveObject( rObject, rDist );
|
||||
@ -127,11 +121,6 @@ SdrUndoAction* OReportUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, S
|
||||
return m_pUndoFactory->CreateUndoDeleteLayer( nLayerNum, rNewLayerAdmin, rNewModel );
|
||||
}
|
||||
|
||||
SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNewPos1)
|
||||
{
|
||||
return m_pUndoFactory->CreateUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNewPos1 );
|
||||
}
|
||||
|
||||
// page
|
||||
SdrUndoAction* OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
|
||||
{
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
ScViewForwarder(ScTabViewShell* pViewShell, ScSplitPos eSplitPos, const ScAddress& rCell);
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
@ -75,34 +74,6 @@ bool ScViewForwarder::IsValid() const
|
||||
return mpViewShell != nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle ScViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpViewShell)
|
||||
{
|
||||
vcl::Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos);
|
||||
if (pWindow)
|
||||
{
|
||||
aVisArea.SetSize(pWindow->GetSizePixel());
|
||||
|
||||
ScHSplitPos eWhichH = ((meSplitPos == SC_SPLIT_TOPLEFT) || (meSplitPos == SC_SPLIT_BOTTOMLEFT)) ?
|
||||
SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
|
||||
ScVSplitPos eWhichV = ((meSplitPos == SC_SPLIT_TOPLEFT) || (meSplitPos == SC_SPLIT_TOPRIGHT)) ?
|
||||
SC_SPLIT_TOP : SC_SPLIT_BOTTOM;
|
||||
|
||||
Point aBaseCellPos(mpViewShell->GetViewData().GetScrPos(mpViewShell->GetViewData().GetPosX(eWhichH),
|
||||
mpViewShell->GetViewData().GetPosY(eWhichV), meSplitPos, true));
|
||||
Point aCellPos(mpViewShell->GetViewData().GetScrPos(maCellPos.Col(), maCellPos.Row(), meSplitPos, true));
|
||||
aVisArea.SetPos(aCellPos - aBaseCellPos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
Point ScViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if (mpViewShell)
|
||||
@ -148,7 +119,6 @@ public:
|
||||
const EditView* _pEditView);
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
@ -168,24 +138,6 @@ bool ScEditObjectViewForwarder::IsValid() const
|
||||
return (mpWindow != nullptr);
|
||||
}
|
||||
|
||||
tools::Rectangle ScEditObjectViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpWindow)
|
||||
{
|
||||
tools::Rectangle aVisRect(mpWindow->GetWindowExtentsRelative(mpWindow->GetAccessibleParentWindow()));
|
||||
|
||||
aVisRect.SetPos(Point(0, 0));
|
||||
|
||||
aVisArea = aVisRect;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
Point ScEditObjectViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if (mpWindow)
|
||||
@ -241,16 +193,10 @@ public:
|
||||
explicit ScPreviewViewForwarder(ScPreviewShell* pViewShell);
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
void SetInvalid();
|
||||
|
||||
tools::Rectangle GetVisRect() const;
|
||||
|
||||
// clips the VisArea and calculates with the negative coordinates
|
||||
tools::Rectangle CorrectVisArea(const tools::Rectangle& rVisArea) const;
|
||||
};
|
||||
|
||||
ScPreviewViewForwarder::ScPreviewViewForwarder(ScPreviewShell* pViewShell)
|
||||
@ -263,12 +209,6 @@ bool ScPreviewViewForwarder::IsValid() const
|
||||
return mpViewShell != nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewViewForwarder::GetVisArea() const
|
||||
{
|
||||
OSL_FAIL("should be implemented in an abrevated class");
|
||||
return tools::Rectangle();
|
||||
}
|
||||
|
||||
Point ScPreviewViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if (mpViewShell)
|
||||
@ -316,89 +256,24 @@ void ScPreviewViewForwarder::SetInvalid()
|
||||
mpViewShell = nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewViewForwarder::GetVisRect() const
|
||||
{
|
||||
if ( mpViewShell )
|
||||
{
|
||||
Size aOutputSize;
|
||||
vcl::Window* pWindow = mpViewShell->GetWindow();
|
||||
if ( pWindow )
|
||||
aOutputSize = pWindow->GetOutputSizePixel();
|
||||
tools::Rectangle aVisRect( Point(), aOutputSize );
|
||||
return aVisRect;
|
||||
}
|
||||
return tools::Rectangle();
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewViewForwarder::CorrectVisArea(const tools::Rectangle& rVisArea) const
|
||||
{
|
||||
tools::Rectangle aVisArea(rVisArea);
|
||||
Point aPos = aVisArea.TopLeft(); // get first the position to remember negative positions after clipping
|
||||
|
||||
vcl::Window* pWin = mpViewShell->GetWindow();
|
||||
if (pWin)
|
||||
aVisArea = pWin->GetWindowExtentsRelative(pWin).GetIntersection(aVisArea);
|
||||
|
||||
sal_Int32 nX(aPos.getX());
|
||||
sal_Int32 nY(aPos.getY());
|
||||
|
||||
if (nX > 0)
|
||||
nX = 0;
|
||||
else if (nX < 0)
|
||||
nX = -nX;
|
||||
if (nY > 0)
|
||||
nY = 0;
|
||||
else if (nY < 0)
|
||||
nY = -nY;
|
||||
aVisArea.SetPos(Point(nX, nY));
|
||||
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
class ScPreviewHeaderFooterViewForwarder : public ScPreviewViewForwarder
|
||||
{
|
||||
bool mbHeader;
|
||||
public:
|
||||
ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell, bool bHeader);
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell);
|
||||
};
|
||||
|
||||
ScPreviewHeaderFooterViewForwarder::ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell, bool bHeader)
|
||||
ScPreviewHeaderFooterViewForwarder::ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell)
|
||||
:
|
||||
ScPreviewViewForwarder(pViewShell),
|
||||
mbHeader(bHeader)
|
||||
ScPreviewViewForwarder(pViewShell)
|
||||
{
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewHeaderFooterViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpViewShell)
|
||||
{
|
||||
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
|
||||
if ( mbHeader )
|
||||
rData.GetHeaderPosition( aVisArea );
|
||||
else
|
||||
rData.GetFooterPosition( aVisArea );
|
||||
|
||||
aVisArea = CorrectVisArea(aVisArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
class ScPreviewCellViewForwarder : public ScPreviewViewForwarder
|
||||
{
|
||||
ScAddress maCellPos;
|
||||
public:
|
||||
ScPreviewCellViewForwarder(ScPreviewShell* pViewShell,
|
||||
const ScAddress& aCellPos);
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
};
|
||||
|
||||
ScPreviewCellViewForwarder::ScPreviewCellViewForwarder(ScPreviewShell* pViewShell,
|
||||
@ -409,101 +284,38 @@ ScPreviewCellViewForwarder::ScPreviewCellViewForwarder(ScPreviewShell* pViewShel
|
||||
{
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewCellViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpViewShell)
|
||||
{
|
||||
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
|
||||
aVisArea = rData.GetCellOutputRect(maCellPos);
|
||||
|
||||
aVisArea = CorrectVisArea(aVisArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
class ScPreviewHeaderCellViewForwarder : public ScPreviewViewForwarder
|
||||
{
|
||||
ScAddress maCellPos;
|
||||
bool mbColHeader;
|
||||
public:
|
||||
ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell,
|
||||
const ScAddress& aCellPos,
|
||||
bool bColHeader);
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
const ScAddress& aCellPos);
|
||||
};
|
||||
|
||||
ScPreviewHeaderCellViewForwarder::ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell,
|
||||
const ScAddress& aCellPos,
|
||||
bool bColHeader)
|
||||
const ScAddress& aCellPos)
|
||||
:
|
||||
ScPreviewViewForwarder(pViewShell),
|
||||
maCellPos(aCellPos),
|
||||
mbColHeader(bColHeader)
|
||||
maCellPos(aCellPos)
|
||||
{
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewHeaderCellViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpViewShell)
|
||||
{
|
||||
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
|
||||
aVisArea = rData.GetHeaderCellOutputRect(GetVisRect(), maCellPos, mbColHeader);
|
||||
|
||||
aVisArea = CorrectVisArea(aVisArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
class ScPreviewNoteViewForwarder : public ScPreviewViewForwarder
|
||||
{
|
||||
ScAddress maCellPos;
|
||||
bool mbNoteMark;
|
||||
public:
|
||||
ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell,
|
||||
const ScAddress& aCellPos,
|
||||
bool bNoteMark);
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
const ScAddress& aCellPos);
|
||||
};
|
||||
|
||||
ScPreviewNoteViewForwarder::ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell,
|
||||
const ScAddress& aCellPos,
|
||||
bool bNoteMark)
|
||||
const ScAddress& aCellPos)
|
||||
:
|
||||
ScPreviewViewForwarder(pViewShell),
|
||||
maCellPos(aCellPos),
|
||||
mbNoteMark(bNoteMark)
|
||||
maCellPos(aCellPos)
|
||||
{
|
||||
}
|
||||
|
||||
tools::Rectangle ScPreviewNoteViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (mpViewShell)
|
||||
{
|
||||
const ScPreviewLocationData& rData = mpViewShell->GetLocationData();
|
||||
aVisArea = rData.GetNoteInRangeOutputRect(GetVisRect(), mbNoteMark, maCellPos);
|
||||
|
||||
aVisArea = CorrectVisArea(aVisArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this ViewForwarder is not valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
class ScEditViewForwarder : public SvxEditViewForwarder
|
||||
{
|
||||
EditView* mpEditView;
|
||||
@ -512,7 +324,6 @@ public:
|
||||
ScEditViewForwarder(EditView* pEditView, vcl::Window* pWin);
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual bool GetSelection( ESelection& rSelection ) const override;
|
||||
@ -535,22 +346,6 @@ bool ScEditViewForwarder::IsValid() const
|
||||
return mpWindow && mpEditView;
|
||||
}
|
||||
|
||||
tools::Rectangle ScEditViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aVisArea;
|
||||
if (IsValid() && mpEditView->GetEditEngine())
|
||||
{
|
||||
MapMode aMapMode(mpEditView->GetEditEngine()->GetRefMapMode());
|
||||
|
||||
aVisArea = mpWindow->LogicToPixel( mpEditView->GetVisArea(), aMapMode );
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_FAIL("this EditViewForwarder is no longer valid");
|
||||
}
|
||||
return aVisArea;
|
||||
}
|
||||
|
||||
Point ScEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if (mpWindow)
|
||||
@ -1281,7 +1076,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
|
||||
SvxViewForwarder* ScAccessiblePreviewHeaderCellTextData::GetViewForwarder()
|
||||
{
|
||||
if (!mpViewForwarder)
|
||||
mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos, mbColHeader));
|
||||
mpViewForwarder.reset(new ScPreviewHeaderCellViewForwarder(mpViewShell, aCellPos));
|
||||
return mpViewForwarder.get();
|
||||
}
|
||||
|
||||
@ -1400,7 +1195,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
|
||||
SvxViewForwarder* ScAccessibleHeaderTextData::GetViewForwarder()
|
||||
{
|
||||
if (!mpViewForwarder)
|
||||
mpViewForwarder = new ScPreviewHeaderFooterViewForwarder(mpViewShell, mbHeader);
|
||||
mpViewForwarder = new ScPreviewHeaderFooterViewForwarder(mpViewShell);
|
||||
return mpViewForwarder;
|
||||
}
|
||||
|
||||
@ -1503,7 +1298,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
|
||||
SvxViewForwarder* ScAccessibleNoteTextData::GetViewForwarder()
|
||||
{
|
||||
if (!mpViewForwarder)
|
||||
mpViewForwarder = new ScPreviewNoteViewForwarder(mpViewShell, maCellPos, mbMarkNote);
|
||||
mpViewForwarder = new ScPreviewNoteViewForwarder(mpViewShell, maCellPos);
|
||||
return mpViewForwarder;
|
||||
}
|
||||
|
||||
@ -1518,7 +1313,6 @@ public:
|
||||
explicit ScCsvViewForwarder( vcl::Window* pWindow, const tools::Rectangle& rBoundBox );
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
@ -1536,11 +1330,6 @@ bool ScCsvViewForwarder::IsValid() const
|
||||
return mpWindow != nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle ScCsvViewForwarder::GetVisArea() const
|
||||
{
|
||||
return maBoundBox;
|
||||
}
|
||||
|
||||
Point ScCsvViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if( !mpWindow ) return Point();
|
||||
|
@ -2718,19 +2718,6 @@ bool ScDocShell::PrepareClose( bool bUI )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
void ScDocShell::PrepareReload()
|
||||
{
|
||||
SfxObjectShell::PrepareReload(); // FIXME: Doesn't do a thing?
|
||||
|
||||
// The Disconnect of DDE Links can trigger a Reschedule.
|
||||
// If the DDE Links are not deleted before the Document dtor,
|
||||
// the DDE Link Update for this Document can be triggered from this Reschedule on Reload.
|
||||
// This causes a hang.
|
||||
//
|
||||
// Thus: Disconnect the DDE Links of the old Document before Reload
|
||||
m_aDocument.GetDocLinkManager().disconnectDdeLinks();
|
||||
}
|
||||
|
||||
OUString ScDocShell::GetOwnFilterName()
|
||||
{
|
||||
return OUString(pFilterSc50);
|
||||
|
@ -202,7 +202,6 @@ public:
|
||||
virtual bool SaveAs( SfxMedium& rMedium ) override;
|
||||
virtual bool ConvertTo( SfxMedium &rMedium ) override;
|
||||
virtual bool PrepareClose( bool bUI = true ) override;
|
||||
virtual void PrepareReload() override;
|
||||
virtual void LoadStyles( SfxObjectShell &rSource ) override;
|
||||
|
||||
virtual bool DoSaveCompleted( SfxMedium * pNewStor=nullptr, bool bRegisterRecent=true ) override; // SfxObjectShell
|
||||
|
@ -91,20 +91,6 @@ ScVbaCondition< Ifc... >::Formula2( )
|
||||
return mxSheetCondition->getFormula2();
|
||||
}
|
||||
|
||||
template< typename... Ifc >
|
||||
void
|
||||
ScVbaCondition< Ifc... >::setFormula1( const uno::Any& _aFormula1)
|
||||
{
|
||||
OUString sFormula;
|
||||
if ( _aFormula1 >>= sFormula )
|
||||
{
|
||||
mxSheetCondition->setFormula1( sFormula );
|
||||
table::CellRangeAddress aCellRangeAddress = mxAddressable->getRangeAddress();
|
||||
table::CellAddress aCellAddress( aCellRangeAddress.Sheet, aCellRangeAddress.StartColumn, aCellRangeAddress.StartRow );
|
||||
mxSheetCondition->setSourcePosition(aCellAddress);
|
||||
}
|
||||
}
|
||||
|
||||
template< typename... Ifc >
|
||||
sal_Int32
|
||||
ScVbaCondition< Ifc... >::Operator(bool _bIncludeFormulaValue)
|
||||
|
@ -39,8 +39,6 @@ public:
|
||||
virtual OUString SAL_CALL Formula1( ) override;
|
||||
virtual OUString SAL_CALL Formula2( ) override;
|
||||
/// @throws css::script::BasicErrorException
|
||||
virtual void setFormula1( const css::uno::Any& _aFormula1);
|
||||
/// @throws css::script::BasicErrorException
|
||||
virtual sal_Int32 Operator(bool _bIncludeFormulaValue);
|
||||
virtual sal_Int32 SAL_CALL Operator() override = 0;
|
||||
|
||||
|
@ -109,14 +109,6 @@ ScVbaFormatCondition::retrieveAPIType(sal_Int32 _nVBAType, const uno::Reference<
|
||||
return aAPIType;
|
||||
}
|
||||
|
||||
void
|
||||
ScVbaFormatCondition::setFormula1( const uno::Any& _aFormula1)
|
||||
{
|
||||
// getA1Formula *SHOULD* detect whether the formula is r1c1 or A1 syntax
|
||||
// and if R1C1 convert to A1
|
||||
ScVbaFormatCondition_BASE::setFormula1( uno::makeAny( ScVbaFormatConditions::getA1Formula(_aFormula1) ) );
|
||||
}
|
||||
|
||||
::sal_Int32 SAL_CALL
|
||||
ScVbaFormatCondition::Type( )
|
||||
{
|
||||
|
@ -58,7 +58,6 @@ public:
|
||||
virtual ::sal_Int32 SAL_CALL Type( ) override;
|
||||
using ScVbaFormatCondition_BASE::Operator;
|
||||
virtual ::sal_Int32 SAL_CALL Operator( ) override;
|
||||
virtual void setFormula1( const css::uno::Any& _aFormula1) override;
|
||||
virtual css::uno::Reference< ::ooo::vba::excel::XInterior > SAL_CALL Interior( ) override;
|
||||
virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& Index ) override;
|
||||
virtual css::uno::Reference< ::ooo::vba::excel::XFont > SAL_CALL Font( ) override;
|
||||
|
@ -196,7 +196,6 @@ public:
|
||||
|
||||
/** Also override ReplaceObject methods to realize when
|
||||
objects are removed with this mechanism instead of RemoveObject*/
|
||||
virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, size_t nObjNum) override;
|
||||
virtual SdrObject* ReplaceObject(SdrObject* pNewObj, size_t nObjNum) override;
|
||||
|
||||
void SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, const OUString& rStr );
|
||||
|
@ -131,8 +131,6 @@ private:
|
||||
/// @throws css::uno::RuntimeException
|
||||
static const SfxItemPropertySimpleEntry* getPropertyMapEntry( const OUString& rPropertyName );
|
||||
|
||||
virtual void Load (SvStream& rIn, sal_uInt16 nVersion) override;
|
||||
|
||||
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
|
||||
virtual ~SdStyleSheet() override;
|
||||
|
||||
|
@ -1713,14 +1713,6 @@ SdrObject* SdPage::NbcRemoveObject(size_t nObjNum)
|
||||
return FmFormPage::NbcRemoveObject(nObjNum);
|
||||
}
|
||||
|
||||
// Also override ReplaceObject methods to realize when
|
||||
// objects are removed with this mechanism instead of RemoveObject
|
||||
SdrObject* SdPage::NbcReplaceObject(SdrObject* pNewObj, size_t nObjNum)
|
||||
{
|
||||
onRemoveObject(GetObj( nObjNum ));
|
||||
return FmFormPage::NbcReplaceObject(pNewObj, nObjNum);
|
||||
}
|
||||
|
||||
// Also override ReplaceObject methods to realize when
|
||||
// objects are removed with this mechanism instead of RemoveObject
|
||||
SdrObject* SdPage::ReplaceObject(SdrObject* pNewObj, size_t nObjNum)
|
||||
|
@ -160,17 +160,6 @@ OUString const & SdStyleSheet::GetApiName() const
|
||||
return GetName();
|
||||
}
|
||||
|
||||
void SdStyleSheet::Load (SvStream& rIn, sal_uInt16 nVersion)
|
||||
{
|
||||
SfxStyleSheetBase::Load(rIn, nVersion);
|
||||
|
||||
/* previously, the default mask was 0xAFFE. The needed flags were masked
|
||||
from this mask. Now the flag SfxStyleSearchBits::ReadOnly was introduced and with
|
||||
this, all style sheets are read only. Since no style sheet should be read
|
||||
only in Draw, we reset the flag here. */
|
||||
nMask &= ~SfxStyleSearchBits::ReadOnly;
|
||||
}
|
||||
|
||||
bool SdStyleSheet::SetParent(const OUString& rParentName)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
@ -121,26 +121,6 @@ namespace accessibility
|
||||
return false;
|
||||
}
|
||||
|
||||
::tools::Rectangle AccessibleOutlineEditSource::GetVisArea() const
|
||||
{
|
||||
if( IsValid() )
|
||||
{
|
||||
SdrPaintWindow* pPaintWindow = mrView.FindPaintWindow(mrWindow);
|
||||
::tools::Rectangle aVisArea;
|
||||
|
||||
if(pPaintWindow)
|
||||
{
|
||||
aVisArea = pPaintWindow->GetVisibleArea();
|
||||
}
|
||||
|
||||
MapMode aMapMode(mrWindow.GetMapMode());
|
||||
aMapMode.SetOrigin(Point());
|
||||
return mrWindow.LogicToPixel( aVisArea, aMapMode );
|
||||
}
|
||||
|
||||
return ::tools::Rectangle();
|
||||
}
|
||||
|
||||
Point AccessibleOutlineEditSource::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
if( IsValid() && mrView.GetModel() )
|
||||
|
@ -341,51 +341,6 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDocShell::InPlaceActivate( bool bActive )
|
||||
{
|
||||
SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(this, false);
|
||||
std::vector<std::unique_ptr<FrameView>> &rViews = mpDoc->GetFrameViewList();
|
||||
|
||||
if( !bActive )
|
||||
{
|
||||
rViews.clear();
|
||||
|
||||
while (pSfxViewFrame)
|
||||
{
|
||||
// determine the number of FrameViews
|
||||
SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell();
|
||||
ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh);
|
||||
|
||||
if ( pViewSh && pViewSh->GetFrameView() )
|
||||
{
|
||||
pViewSh->WriteFrameViewData();
|
||||
rViews.push_back( o3tl::make_unique<FrameView>( mpDoc, pViewSh->GetFrameView() ) );
|
||||
}
|
||||
|
||||
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
|
||||
}
|
||||
}
|
||||
|
||||
SfxObjectShell::InPlaceActivate( bActive );
|
||||
|
||||
if( bActive )
|
||||
{
|
||||
for( std::vector<FrameView*>::size_type i = 0; pSfxViewFrame && (i < rViews.size()); i++ )
|
||||
{
|
||||
// determine the number of FrameViews
|
||||
SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell();
|
||||
ViewShell* pViewSh = dynamic_cast<ViewShell*>(pSfxViewSh);
|
||||
|
||||
if ( pViewSh )
|
||||
{
|
||||
pViewSh->ReadFrameViewData( rViews[ i ].get() );
|
||||
}
|
||||
|
||||
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDocShell::Activate( bool bMDI)
|
||||
{
|
||||
if (bMDI)
|
||||
|
@ -63,7 +63,6 @@ namespace accessibility
|
||||
|
||||
// the view forwarder
|
||||
virtual bool IsValid() const override;
|
||||
virtual ::tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
|
@ -221,7 +221,6 @@ protected:
|
||||
|
||||
bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
|
||||
void Construct(bool bClipboard);
|
||||
virtual void InPlaceActivate( bool bActive ) override;
|
||||
private:
|
||||
static void setEditMode(DrawViewShell* pDrawViewShell, bool isMasterPage);
|
||||
};
|
||||
|
@ -180,7 +180,6 @@ public:
|
||||
virtual bool HasMarkablePoints() const override;
|
||||
virtual sal_Int32 GetMarkablePointCount() const override;
|
||||
virtual bool HasMarkedPoints() const override;
|
||||
virtual sal_Int32 GetMarkedPointCount() const override;
|
||||
virtual bool IsPointMarkable(const SdrHdl& rHdl) const override;
|
||||
virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) override;
|
||||
virtual void CheckPossibilities() override;
|
||||
|
@ -1144,13 +1144,6 @@ bool View::HasMarkedPoints() const
|
||||
return FmFormView::HasMarkedPoints();
|
||||
}
|
||||
|
||||
sal_Int32 View::GetMarkedPointCount() const
|
||||
{
|
||||
sal_Int32 nCount = FmFormView::GetMarkedPointCount();
|
||||
nCount += maSmartTags.GetMarkedPointCount();
|
||||
return nCount;
|
||||
}
|
||||
|
||||
bool View::IsPointMarkable(const SdrHdl& rHdl) const
|
||||
{
|
||||
if( SmartTagSet::IsPointMarkable( rHdl ) )
|
||||
|
@ -254,7 +254,6 @@ namespace pdfi
|
||||
|
||||
virtual void visitedBy( ElementTreeVisitor&, const std::list< std::unique_ptr<Element> >::const_iterator& rParentIt ) override;
|
||||
|
||||
static void updateParagraphGeometry( Element* pEle );
|
||||
void resolveHyperlinks();
|
||||
void resolveFontStyles( PDFIProcessor const & rProc );
|
||||
void resolveUnderlines( PDFIProcessor const & rProc );
|
||||
|
@ -265,36 +265,6 @@ void PageElement::visitedBy( ElementTreeVisitor& rVisit
|
||||
rVisitor.visit(*this, rParentIt);
|
||||
}
|
||||
|
||||
void PageElement::updateParagraphGeometry( Element* pEle )
|
||||
{
|
||||
// update geometry of children
|
||||
for( auto it = pEle->Children.begin();
|
||||
it != pEle->Children.end(); ++it )
|
||||
{
|
||||
updateParagraphGeometry( it->get() );
|
||||
}
|
||||
// if this is a paragraph itself, then update according to children geometry
|
||||
if( dynamic_cast<ParagraphElement*>(pEle) )
|
||||
{
|
||||
for( auto it = pEle->Children.begin();
|
||||
it != pEle->Children.end(); ++it )
|
||||
{
|
||||
Element* pChild = nullptr;
|
||||
TextElement* pText = dynamic_cast<TextElement*>(it->get());
|
||||
if( pText )
|
||||
pChild = pText;
|
||||
else
|
||||
{
|
||||
ParagraphElement* pPara = dynamic_cast<ParagraphElement*>(it->get());
|
||||
if( pPara )
|
||||
pChild = pPara;
|
||||
}
|
||||
if( pChild )
|
||||
pEle->updateGeometryWith( pChild );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PageElement::resolveHyperlink( const std::list<std::unique_ptr<Element>>::iterator& link_it, std::list<std::unique_ptr<Element>>& rElements )
|
||||
{
|
||||
HyperlinkElement* pLink = dynamic_cast<HyperlinkElement*>(link_it->get());
|
||||
|
@ -897,13 +897,6 @@ void SfxObjectShell::SetActivateEvent_Impl(SfxEventHintId nId )
|
||||
pImpl->nEventId = nId;
|
||||
}
|
||||
|
||||
void SfxObjectShell::PrepareReload( )
|
||||
/*
|
||||
Is called before the Reload and gives the opportunity to clear any caches.
|
||||
*/
|
||||
{
|
||||
}
|
||||
|
||||
bool SfxObjectShell::IsAutoLoadLocked() const
|
||||
|
||||
/* Returns whether an Autoload is allowed to be executed. Before the
|
||||
@ -1647,10 +1640,6 @@ bool SfxObjectShell::IsUIActive()
|
||||
return pFrame && pFrame->GetFrame().IsInPlace() && pFrame->GetFrame().GetWorkWindow_Impl()->IsVisible_Impl();
|
||||
}
|
||||
|
||||
void SfxObjectShell::InPlaceActivate( bool )
|
||||
{
|
||||
}
|
||||
|
||||
bool SfxObjectShell::UseInteractionToHandleError(
|
||||
const uno::Reference< task::XInteractionHandler >& xHandler,
|
||||
ErrCode nError )
|
||||
|
@ -650,14 +650,6 @@ namespace slideshow
|
||||
return mbCharRotationAngleValid || ( haveChild() && mpChild->isCharRotationAngleValid() );
|
||||
}
|
||||
|
||||
double ShapeAttributeLayer::getCharRotationAngle() const
|
||||
{
|
||||
return calcValue( mnCharRotationAngle,
|
||||
mbCharRotationAngleValid,
|
||||
&ShapeAttributeLayer::isCharRotationAngleValid,
|
||||
&ShapeAttributeLayer::getCharRotationAngle );
|
||||
}
|
||||
|
||||
void ShapeAttributeLayer::setCharRotationAngle( const double& rNewAngle )
|
||||
{
|
||||
ENSURE_OR_THROW( ::rtl::math::isFinite(rNewAngle),
|
||||
|
@ -378,11 +378,7 @@ namespace slideshow
|
||||
/** Query whether the char rotation angle attribute is valid
|
||||
*/
|
||||
bool isCharRotationAngleValid() const;
|
||||
/** Query the current text rotation angle of the shape
|
||||
|
||||
@return the text rotation angle in degrees.
|
||||
*/
|
||||
double getCharRotationAngle() const;
|
||||
/** Set the new text rotation angle of the shape
|
||||
|
||||
@param rNewAngle
|
||||
|
@ -807,32 +807,6 @@ bool SmViewForwarder::IsValid() const
|
||||
return rEditAcc.GetEditView() != nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle SmViewForwarder::GetVisArea() const
|
||||
{
|
||||
EditView *pEditView = rEditAcc.GetEditView();
|
||||
OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr;
|
||||
|
||||
if( pOutDev && pEditView)
|
||||
{
|
||||
tools::Rectangle aVisArea = pEditView->GetVisArea();
|
||||
|
||||
// figure out map mode from edit engine
|
||||
EditEngine* pEditEngine = pEditView->GetEditEngine();
|
||||
|
||||
if( pEditEngine )
|
||||
{
|
||||
MapMode aMapMode(pOutDev->GetMapMode());
|
||||
aVisArea = OutputDevice::LogicToLogic( aVisArea,
|
||||
pEditEngine->GetRefMapMode(),
|
||||
MapMode(aMapMode.GetMapUnit()));
|
||||
aMapMode.SetOrigin(Point());
|
||||
return pOutDev->LogicToPixel( aVisArea, aMapMode );
|
||||
}
|
||||
}
|
||||
|
||||
return tools::Rectangle();
|
||||
}
|
||||
|
||||
Point SmViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
EditView *pEditView = rEditAcc.GetEditView();
|
||||
@ -1412,33 +1386,6 @@ bool SmEditViewForwarder::IsValid() const
|
||||
return rEditAcc.GetEditView() != nullptr;
|
||||
}
|
||||
|
||||
tools::Rectangle SmEditViewForwarder::GetVisArea() const
|
||||
{
|
||||
tools::Rectangle aRect(0,0,0,0);
|
||||
|
||||
EditView *pEditView = rEditAcc.GetEditView();
|
||||
OutputDevice* pOutDev = pEditView ? pEditView->GetWindow() : nullptr;
|
||||
|
||||
if( pOutDev && pEditView)
|
||||
{
|
||||
tools::Rectangle aVisArea = pEditView->GetVisArea();
|
||||
|
||||
// figure out map mode from edit engine
|
||||
EditEngine* pEditEngine = pEditView->GetEditEngine();
|
||||
|
||||
if( pEditEngine )
|
||||
{
|
||||
MapMode aMapMode(pOutDev->GetMapMode());
|
||||
aVisArea = OutputDevice::LogicToLogic( aVisArea,
|
||||
pEditEngine->GetRefMapMode(),
|
||||
MapMode(aMapMode.GetMapUnit()));
|
||||
aMapMode.SetOrigin(Point());
|
||||
aRect = pOutDev->LogicToPixel( aVisArea, aMapMode );
|
||||
}
|
||||
}
|
||||
|
||||
return aRect;
|
||||
}
|
||||
|
||||
Point SmEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
|
@ -161,7 +161,6 @@ public:
|
||||
virtual ~SmViewForwarder() override;
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
};
|
||||
@ -250,7 +249,6 @@ public:
|
||||
|
||||
virtual bool IsValid() const override;
|
||||
|
||||
virtual tools::Rectangle GetVisArea() const override;
|
||||
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const override;
|
||||
|
||||
|
@ -835,10 +835,6 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld,
|
||||
SetSearchMask(GetSearchFamily(), nTmpMask);
|
||||
}
|
||||
|
||||
void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 )
|
||||
{
|
||||
}
|
||||
|
||||
SfxStyleSheet::SfxStyleSheet(const OUString &rName,
|
||||
const SfxStyleSheetBasePool& r_Pool,
|
||||
SfxStyleFamily eFam,
|
||||
|
@ -76,9 +76,6 @@ namespace sdr
|
||||
// this ObjectContact.
|
||||
virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const override;
|
||||
|
||||
// Get info if given Rectangle is visible in this view
|
||||
virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const override;
|
||||
|
||||
// Get info about the need to visualize GluePoints. The default
|
||||
// is that it is not necessary.
|
||||
virtual bool AreGluePointsVisible() const override;
|
||||
@ -92,12 +89,6 @@ namespace sdr
|
||||
// print? Default is false
|
||||
virtual bool isOutputToPrinter() const override;
|
||||
|
||||
// window? Default is true
|
||||
virtual bool isOutputToWindow() const override;
|
||||
|
||||
// VirtualDevice? Default is false
|
||||
virtual bool isOutputToVirtualDevice() const override;
|
||||
|
||||
// recording MetaFile? Default is false
|
||||
virtual bool isOutputToRecordingMetaFile() const override;
|
||||
|
||||
@ -107,9 +98,6 @@ namespace sdr
|
||||
// gray display mode
|
||||
virtual bool isDrawModeGray() const override;
|
||||
|
||||
// gray display mode
|
||||
virtual bool isDrawModeBlackWhite() const override;
|
||||
|
||||
// high contrast display mode
|
||||
virtual bool isDrawModeHighContrast() const override;
|
||||
|
||||
|
@ -67,9 +67,6 @@ namespace sdr
|
||||
// flush. Do buffered updates.
|
||||
virtual void flush() override;
|
||||
|
||||
// restore part of background. Implemented form buffered versions only.
|
||||
virtual void restoreBackground(const vcl::Region& rRegion) const override;
|
||||
|
||||
// invalidate the given range at local OutputDevice
|
||||
virtual void invalidateRange(const basegfx::B2DRange& rRange) override;
|
||||
};
|
||||
|
@ -158,7 +158,6 @@ namespace accessibility
|
||||
sal_Int16 GetDepth( sal_Int32 ) const override { return -1; }
|
||||
bool SetDepth( sal_Int32, sal_Int16 ) override { return true; }
|
||||
|
||||
tools::Rectangle GetVisArea() const override { return tools::Rectangle(); }
|
||||
Point LogicToPixel( const Point& rPoint, const MapMode& /*rMapMode*/ ) const override { return rPoint; }
|
||||
Point PixelToLogic( const Point& rPoint, const MapMode& /*rMapMode*/ ) const override { return rPoint; }
|
||||
|
||||
|
@ -121,13 +121,6 @@ void ObjectContact::InvalidatePartOfView(const basegfx::B2DRange& /*rRange*/) co
|
||||
// nothing to do here in the default version
|
||||
}
|
||||
|
||||
// Get info if given Rectangle is visible in this view
|
||||
bool ObjectContact::IsAreaVisible(const basegfx::B2DRange& /*rRange*/) const
|
||||
{
|
||||
// always visible in default version
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get info about the need to visualize GluePoints
|
||||
bool ObjectContact::AreGluePointsVisible() const
|
||||
{
|
||||
@ -160,18 +153,6 @@ bool ObjectContact::isOutputToPrinter() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// window? Default is true
|
||||
bool ObjectContact::isOutputToWindow() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// VirtualDevice? Default is false
|
||||
bool ObjectContact::isOutputToVirtualDevice() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// recording MetaFile? Default is false
|
||||
bool ObjectContact::isOutputToRecordingMetaFile() const
|
||||
{
|
||||
@ -190,12 +171,6 @@ bool ObjectContact::isDrawModeGray() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// gray display mode
|
||||
bool ObjectContact::isDrawModeBlackWhite() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// high contrast display mode
|
||||
bool ObjectContact::isDrawModeHighContrast() const
|
||||
{
|
||||
|
@ -128,12 +128,6 @@ void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
|
||||
}
|
||||
}
|
||||
|
||||
// VirtualDevice?
|
||||
bool ObjectContactOfObjListPainter::isOutputToVirtualDevice() const
|
||||
{
|
||||
return (OUTDEV_VIRDEV == mrTargetOutputDevice.GetOutDevType());
|
||||
}
|
||||
|
||||
// recording MetaFile?
|
||||
bool ObjectContactOfObjListPainter::isOutputToRecordingMetaFile() const
|
||||
{
|
||||
|
@ -354,33 +354,6 @@ namespace sdr
|
||||
GetPageWindow().InvalidatePageWindow(rRange);
|
||||
}
|
||||
|
||||
// Get info if given Rectangle is visible in this view
|
||||
bool ObjectContactOfPageView::IsAreaVisible(const basegfx::B2DRange& rRange) const
|
||||
{
|
||||
// compare with the visible rectangle
|
||||
if(rRange.isEmpty())
|
||||
{
|
||||
// no range -> not visible
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
const OutputDevice& rTargetOutDev = GetPageWindow().GetPaintWindow().GetTargetOutputDevice();
|
||||
const Size aOutputSizePixel(rTargetOutDev.GetOutputSizePixel());
|
||||
basegfx::B2DRange aLogicViewRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
|
||||
|
||||
aLogicViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
|
||||
|
||||
if(!aLogicViewRange.isEmpty() && !aLogicViewRange.overlaps(rRange))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// call parent
|
||||
return ObjectContact::IsAreaVisible(rRange);
|
||||
}
|
||||
|
||||
// Get info about the need to visualize GluePoints
|
||||
bool ObjectContactOfPageView::AreGluePointsVisible() const
|
||||
{
|
||||
@ -413,18 +386,6 @@ namespace sdr
|
||||
return (OUTDEV_PRINTER == mrPageWindow.GetPaintWindow().GetOutputDevice().GetOutDevType());
|
||||
}
|
||||
|
||||
// window?
|
||||
bool ObjectContactOfPageView::isOutputToWindow() const
|
||||
{
|
||||
return (OUTDEV_WINDOW == mrPageWindow.GetPaintWindow().GetOutputDevice().GetOutDevType());
|
||||
}
|
||||
|
||||
// VirtualDevice?
|
||||
bool ObjectContactOfPageView::isOutputToVirtualDevice() const
|
||||
{
|
||||
return (OUTDEV_VIRDEV == mrPageWindow.GetPaintWindow().GetOutputDevice().GetOutDevType());
|
||||
}
|
||||
|
||||
// recording MetaFile?
|
||||
bool ObjectContactOfPageView::isOutputToRecordingMetaFile() const
|
||||
{
|
||||
@ -445,13 +406,6 @@ namespace sdr
|
||||
return (nDrawMode == (DrawModeFlags::GrayLine|DrawModeFlags::GrayFill|DrawModeFlags::BlackText|DrawModeFlags::GrayBitmap|DrawModeFlags::GrayGradient));
|
||||
}
|
||||
|
||||
// gray display mode
|
||||
bool ObjectContactOfPageView::isDrawModeBlackWhite() const
|
||||
{
|
||||
const DrawModeFlags nDrawMode(mrPageWindow.GetPaintWindow().GetOutputDevice().GetDrawMode());
|
||||
return (nDrawMode == (DrawModeFlags::BlackLine|DrawModeFlags::BlackText|DrawModeFlags::WhiteFill|DrawModeFlags::GrayBitmap|DrawModeFlags::WhiteGradient));
|
||||
}
|
||||
|
||||
// high contrast display mode
|
||||
bool ObjectContactOfPageView::isDrawModeHighContrast() const
|
||||
{
|
||||
|
@ -64,12 +64,9 @@ public:
|
||||
|
||||
// forward access to SdrPageView of ViewObjectContactOfPageObj
|
||||
virtual bool isOutputToPrinter() const override;
|
||||
virtual bool isOutputToWindow() const override;
|
||||
virtual bool isOutputToVirtualDevice() const override;
|
||||
virtual bool isOutputToRecordingMetaFile() const override;
|
||||
virtual bool isOutputToPDFFile() const override;
|
||||
virtual bool isDrawModeGray() const override;
|
||||
virtual bool isDrawModeBlackWhite() const override;
|
||||
virtual bool isDrawModeHighContrast() const override;
|
||||
virtual SdrPageView* TryToGetSdrPageView() const override;
|
||||
virtual OutputDevice* TryToGetOutputDevice() const override;
|
||||
@ -177,12 +174,9 @@ void PagePrimitiveExtractor::InvalidatePartOfView(const basegfx::B2DRange& rRang
|
||||
|
||||
// forward access to SdrPageView to VOCOfPageObj
|
||||
bool PagePrimitiveExtractor::isOutputToPrinter() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPrinter(); }
|
||||
bool PagePrimitiveExtractor::isOutputToWindow() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToWindow(); }
|
||||
bool PagePrimitiveExtractor::isOutputToVirtualDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToVirtualDevice(); }
|
||||
bool PagePrimitiveExtractor::isOutputToRecordingMetaFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToRecordingMetaFile(); }
|
||||
bool PagePrimitiveExtractor::isOutputToPDFFile() const { return mrViewObjectContactOfPageObj.GetObjectContact().isOutputToPDFFile(); }
|
||||
bool PagePrimitiveExtractor::isDrawModeGray() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeGray(); }
|
||||
bool PagePrimitiveExtractor::isDrawModeBlackWhite() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeBlackWhite(); }
|
||||
bool PagePrimitiveExtractor::isDrawModeHighContrast() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeHighContrast(); }
|
||||
SdrPageView* PagePrimitiveExtractor::TryToGetSdrPageView() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetSdrPageView(); }
|
||||
OutputDevice* PagePrimitiveExtractor::TryToGetOutputDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetOutputDevice(); }
|
||||
|
@ -261,11 +261,6 @@ namespace sdr
|
||||
// default has nothing to do
|
||||
}
|
||||
|
||||
void OverlayManager::restoreBackground(const vcl::Region& /*rRegion*/) const
|
||||
{
|
||||
// unbuffered versions do nothing here
|
||||
}
|
||||
|
||||
void OverlayManager::add(OverlayObject& rOverlayObject)
|
||||
{
|
||||
OSL_ENSURE(nullptr == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)");
|
||||
|
@ -413,16 +413,6 @@ namespace sdr
|
||||
ImpBufferTimerHandler(nullptr);
|
||||
}
|
||||
|
||||
void OverlayManagerBuffered::restoreBackground(const vcl::Region& rRegion) const
|
||||
{
|
||||
// restore
|
||||
const vcl::Region aRegionPixel(getOutputDevice().LogicToPixel(rRegion));
|
||||
ImpRestoreBackground(aRegionPixel);
|
||||
|
||||
// call parent
|
||||
OverlayManager::restoreBackground(rRegion);
|
||||
}
|
||||
|
||||
void OverlayManagerBuffered::invalidateRange(const basegfx::B2DRange& rRange)
|
||||
{
|
||||
if(!rRange.isEmpty())
|
||||
|
@ -82,23 +82,6 @@ bool SdrMarkView::HasMarkedPoints() const
|
||||
return bRet;
|
||||
}
|
||||
|
||||
sal_Int32 SdrMarkView::GetMarkedPointCount() const
|
||||
{
|
||||
ForceUndirtyMrkPnt();
|
||||
sal_Int32 nCount=0;
|
||||
if (!ImpIsFrameHandles()) {
|
||||
size_t nMarkCount=GetMarkedObjectCount();
|
||||
if (nMarkCount<=static_cast<size_t>(mnFrameHandlesLimit)) {
|
||||
for (size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum) {
|
||||
const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
|
||||
const SdrUShortCont& rPts = pM->GetMarkedPoints();
|
||||
nCount += rPts.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
return nCount;
|
||||
}
|
||||
|
||||
bool SdrMarkView::IsPointMarkable(const SdrHdl& rHdl) const
|
||||
{
|
||||
return !ImpIsFrameHandles() && !rHdl.IsPlusHdl() && rHdl.GetKind()!=SdrHdlKind::Glue && rHdl.GetKind()!=SdrHdlKind::SmartTag && rHdl.GetObj()!=nullptr && rHdl.GetObj()->IsPolyObj();
|
||||
|
@ -1754,17 +1754,6 @@ void SdrObject::NbcReformatText()
|
||||
{
|
||||
}
|
||||
|
||||
void SdrObject::ReformatText()
|
||||
{
|
||||
tools::Rectangle aBoundRect0; if (pUserCall!=nullptr) aBoundRect0=GetLastBoundRect();
|
||||
NbcReformatText();
|
||||
SetChanged();
|
||||
BroadcastObjectChange();
|
||||
if (GetCurrentBoundRect()!=aBoundRect0) {
|
||||
SendUserCall(SdrUserCallType::Resize,aBoundRect0);
|
||||
}
|
||||
}
|
||||
|
||||
void SdrObject::BurnInStyleSheetAttributes()
|
||||
{
|
||||
GetProperties().ForceStyleToHardAttributes();
|
||||
@ -1813,11 +1802,6 @@ bool SdrObject::DoMacro(const SdrObjMacroHitRec&)
|
||||
return false;
|
||||
}
|
||||
|
||||
OUString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec&) const
|
||||
{
|
||||
return OUString();
|
||||
}
|
||||
|
||||
bool SdrObject::IsMacroHit(const SdrObjMacroHitRec& rRec) const
|
||||
{
|
||||
return CheckMacroHit(rRec) != nullptr;
|
||||
|
@ -766,11 +766,6 @@ void SdrObjGroup::NbcReformatText()
|
||||
NbcReformatAllTextObjects();
|
||||
}
|
||||
|
||||
void SdrObjGroup::ReformatText()
|
||||
{
|
||||
ReformatAllTextObjects();
|
||||
}
|
||||
|
||||
SdrObject* SdrObjGroup::DoConvertToPolyObj(bool bBezier, bool bAddText) const
|
||||
{
|
||||
SdrObject* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
|
||||
|
@ -1430,21 +1430,6 @@ void SdrTextObj::NbcReformatText()
|
||||
}
|
||||
}
|
||||
|
||||
void SdrTextObj::ReformatText()
|
||||
{
|
||||
if(GetOutlinerParaObject())
|
||||
{
|
||||
tools::Rectangle aBoundRect0;
|
||||
if (pUserCall!=nullptr)
|
||||
aBoundRect0=GetLastBoundRect();
|
||||
|
||||
NbcReformatText();
|
||||
SetChanged();
|
||||
BroadcastObjectChange();
|
||||
SendUserCall(SdrUserCallType::Resize,aBoundRect0);
|
||||
}
|
||||
}
|
||||
|
||||
SdrObjGeoData* SdrTextObj::NewGeoData() const
|
||||
{
|
||||
return new SdrTextObjGeoData;
|
||||
|
@ -520,12 +520,6 @@ void SdrVirtObj::NbcReformatText()
|
||||
rRefObj.NbcReformatText();
|
||||
}
|
||||
|
||||
void SdrVirtObj::ReformatText()
|
||||
{
|
||||
rRefObj.ReformatText();
|
||||
}
|
||||
|
||||
|
||||
bool SdrVirtObj::HasMacro() const
|
||||
{
|
||||
return rRefObj.HasMacro();
|
||||
@ -551,11 +545,6 @@ bool SdrVirtObj::DoMacro(const SdrObjMacroHitRec& rRec)
|
||||
return rRefObj.DoMacro(rRec); // TODO: positioning offset
|
||||
}
|
||||
|
||||
OUString SdrVirtObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
|
||||
{
|
||||
return rRefObj.GetMacroPopupComment(rRec); // TODO: positioning offset
|
||||
}
|
||||
|
||||
const Point SdrVirtObj::GetOffset() const
|
||||
{
|
||||
// #i73248# default offset of SdrVirtObj is aAnchor
|
||||
|
@ -450,39 +450,6 @@ SdrObject* SdrObjList::RemoveObject(size_t nObjNum)
|
||||
return pObj;
|
||||
}
|
||||
|
||||
SdrObject* SdrObjList::NbcReplaceObject(SdrObject* pNewObj, size_t nObjNum)
|
||||
{
|
||||
if (nObjNum >= maList.size() || pNewObj == nullptr)
|
||||
{
|
||||
OSL_ASSERT(nObjNum<maList.size());
|
||||
OSL_ASSERT(pNewObj!=nullptr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SdrObject* pObj=maList[nObjNum];
|
||||
DBG_ASSERT(pObj!=nullptr,"SdrObjList::ReplaceObject: Could not find object to remove.");
|
||||
if (pObj!=nullptr) {
|
||||
DBG_ASSERT(pObj->IsInserted(),"SdrObjList::ReplaceObject: the object does not have status Inserted.");
|
||||
pObj->InsertedStateChange();
|
||||
SetParentAtSdrObjectFromSdrObjList(*pObj, nullptr);
|
||||
ReplaceObjectInContainer(*pNewObj,nObjNum);
|
||||
|
||||
// flushViewObjectContacts() clears the VOC's and those invalidate
|
||||
pObj->GetViewContact().flushViewObjectContacts();
|
||||
|
||||
pNewObj->SetOrdNum(nObjNum);
|
||||
SetParentAtSdrObjectFromSdrObjList(*pNewObj, this);
|
||||
|
||||
// Inform the parent about change to allow invalidations at
|
||||
// evtl. existing parent visualisations
|
||||
impChildInserted(*pNewObj);
|
||||
|
||||
pNewObj->InsertedStateChange();
|
||||
SetSdrObjListRectsDirty();
|
||||
}
|
||||
return pObj;
|
||||
}
|
||||
|
||||
SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, size_t nObjNum)
|
||||
{
|
||||
if (nObjNum >= maList.size())
|
||||
|
@ -1718,11 +1718,8 @@ OUString SdrUndoPageChangeMasterPage::GetComment() const
|
||||
|
||||
|
||||
SdrUndoFactory::~SdrUndoFactory(){}
|
||||
|
||||
// shapes
|
||||
SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
|
||||
{
|
||||
return new SdrUndoMoveObj( rObject );
|
||||
}
|
||||
|
||||
SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
|
||||
{
|
||||
@ -1804,11 +1801,6 @@ SdrUndoAction* SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLa
|
||||
return new SdrUndoDelLayer( nLayerNum, rNewLayerAdmin, rNewModel );
|
||||
}
|
||||
|
||||
SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNewPos1)
|
||||
{
|
||||
return new SdrUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNewPos1 );
|
||||
}
|
||||
|
||||
// page
|
||||
SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
|
||||
{
|
||||
|
@ -2006,18 +2006,6 @@ void SdrTableObj::NbcReformatText()
|
||||
}
|
||||
|
||||
|
||||
void SdrTableObj::ReformatText()
|
||||
{
|
||||
tools::Rectangle aBoundRect0;
|
||||
if (pUserCall!=nullptr)
|
||||
aBoundRect0=GetLastBoundRect();
|
||||
NbcReformatText();
|
||||
SetChanged();
|
||||
BroadcastObjectChange();
|
||||
SendUserCall(SdrUserCallType::Resize,aBoundRect0);
|
||||
}
|
||||
|
||||
|
||||
bool SdrTableObj::IsVerticalWriting() const
|
||||
{
|
||||
const SvxWritingModeItem* pModeItem = &GetObjectItem( SDRATTR_TEXTDIRECTION );
|
||||
|
@ -139,7 +139,6 @@ public:
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
tools::Rectangle GetVisArea();
|
||||
Point LogicToPixel( const Point&, const MapMode& rMapMode );
|
||||
Point PixelToLogic( const Point&, const MapMode& rMapMode );
|
||||
|
||||
@ -822,35 +821,6 @@ bool SvxTextEditSourceImpl::IsValid() const
|
||||
return mpView && mpWindow;
|
||||
}
|
||||
|
||||
tools::Rectangle SvxTextEditSourceImpl::GetVisArea()
|
||||
{
|
||||
if( IsValid() )
|
||||
{
|
||||
SdrPaintWindow* pPaintWindow = mpView->FindPaintWindow(*mpWindow);
|
||||
tools::Rectangle aVisArea;
|
||||
|
||||
if(pPaintWindow)
|
||||
{
|
||||
aVisArea = pPaintWindow->GetVisibleArea();
|
||||
}
|
||||
|
||||
// offset vis area by edit engine left-top position
|
||||
SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
|
||||
if( pTextObj )
|
||||
{
|
||||
tools::Rectangle aAnchorRect;
|
||||
pTextObj->TakeTextAnchorRect( aAnchorRect );
|
||||
aVisArea.Move( -aAnchorRect.Left(), -aAnchorRect.Top() );
|
||||
|
||||
MapMode aMapMode(mpWindow->GetMapMode());
|
||||
aMapMode.SetOrigin(Point());
|
||||
return mpWindow->LogicToPixel( aVisArea, aMapMode );
|
||||
}
|
||||
}
|
||||
|
||||
return tools::Rectangle();
|
||||
}
|
||||
|
||||
Point SvxTextEditSourceImpl::LogicToPixel( const Point& rPoint, const MapMode& rMapMode )
|
||||
{
|
||||
// The responsibilities of ViewForwarder happen to be
|
||||
@ -999,11 +969,6 @@ bool SvxTextEditSource::IsValid() const
|
||||
return mpImpl->IsValid();
|
||||
}
|
||||
|
||||
tools::Rectangle SvxTextEditSource::GetVisArea() const
|
||||
{
|
||||
return mpImpl->GetVisArea();
|
||||
}
|
||||
|
||||
Point SvxTextEditSource::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
|
||||
{
|
||||
return mpImpl->LogicToPixel( rPoint, rMapMode );
|
||||
|
@ -188,7 +188,6 @@ public:
|
||||
virtual OutputDevice* GetDocumentRefDev() override;
|
||||
virtual void OnDocumentPrinterChanged( Printer * pNewPrinter ) override;
|
||||
|
||||
virtual void PrepareReload() override;
|
||||
virtual void SetModified( bool = true ) override;
|
||||
|
||||
/// Dispatcher
|
||||
|
@ -1187,10 +1187,6 @@ void SwDocShell::SetView(SwView* pVw)
|
||||
m_pWrtShell = nullptr;
|
||||
}
|
||||
|
||||
void SwDocShell::PrepareReload()
|
||||
{
|
||||
}
|
||||
|
||||
// #i59688#
|
||||
// linked graphics are now loaded on demand.
|
||||
// Thus, loading of linked graphics no longer needed and necessary for
|
||||
|
@ -50,7 +50,6 @@ public:
|
||||
bool IsCreateObj() const { return m_bCreateObj; }
|
||||
|
||||
// mouse- & key events; return value=true: event was edited
|
||||
virtual bool KeyInput(const KeyEvent& rKEvt);
|
||||
virtual bool MouseMove(const MouseEvent& rMEvt);
|
||||
virtual bool MouseButtonUp(const MouseEvent& rMEvt);
|
||||
virtual bool MouseButtonDown(const MouseEvent& rMEvt);
|
||||
|
@ -27,9 +27,6 @@ class DrawSelection : public SwDrawBase
|
||||
public:
|
||||
DrawSelection(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView);
|
||||
|
||||
// mouse- & key events
|
||||
virtual bool KeyInput(const KeyEvent& rKEvt) override;
|
||||
|
||||
virtual void Activate(const sal_uInt16 nSlotId) override; // activate function
|
||||
};
|
||||
|
||||
|
@ -460,91 +460,6 @@ void SwDrawBase::Deactivate()
|
||||
// If a KeyEvent is processed then the return value is true, otherwise
|
||||
// false.
|
||||
|
||||
bool SwDrawBase::KeyInput(const KeyEvent& rKEvt)
|
||||
{
|
||||
bool bReturn = false;
|
||||
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
|
||||
|
||||
switch (nCode)
|
||||
{
|
||||
case KEY_ESCAPE:
|
||||
{
|
||||
if (m_pWin->IsDrawAction())
|
||||
{
|
||||
BreakCreate();
|
||||
m_pView->LeaveDrawCreate();
|
||||
}
|
||||
|
||||
bReturn = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_DELETE:
|
||||
{
|
||||
m_pSh->DelSelectedObj();
|
||||
bReturn = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
case KEY_DOWN:
|
||||
case KEY_LEFT:
|
||||
case KEY_RIGHT:
|
||||
{
|
||||
SdrView *pSdrView = m_pSh->GetDrawView();
|
||||
|
||||
if (!pSdrView->IsTextEdit())
|
||||
{
|
||||
long nX = 0;
|
||||
long nY = 0;
|
||||
|
||||
if (nCode == KEY_UP)
|
||||
{
|
||||
// Scroll to top
|
||||
nX = 0;
|
||||
nY =-1;
|
||||
}
|
||||
else if (nCode == KEY_DOWN)
|
||||
{
|
||||
// Scroll down
|
||||
nX = 0;
|
||||
nY = 1;
|
||||
}
|
||||
else if (nCode == KEY_LEFT)
|
||||
{
|
||||
// Scroll left
|
||||
nX =-1;
|
||||
nY = 0;
|
||||
}
|
||||
else if (nCode == KEY_RIGHT)
|
||||
{
|
||||
// Scroll right
|
||||
nX = 1;
|
||||
nY = 0;
|
||||
}
|
||||
|
||||
if (pSdrView->AreObjectsMarked() && rKEvt.GetKeyCode().IsMod2())
|
||||
{
|
||||
// Move objects
|
||||
nX *= 100;
|
||||
nY *= 100;
|
||||
pSdrView->MoveAllMarked(Size(nX, nY));
|
||||
}
|
||||
|
||||
bReturn = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
// Process keyboard events
|
||||
|
||||
// If a KeyEvent is processed then the return value is true, otherwise
|
||||
// false.
|
||||
|
||||
void SwDrawBase::BreakCreate()
|
||||
{
|
||||
m_pSh->BreakCreate();
|
||||
|
@ -31,35 +31,6 @@ DrawSelection::DrawSelection(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView*
|
||||
m_bCreateObj = false;
|
||||
}
|
||||
|
||||
// Process keyboard events
|
||||
|
||||
// If a KeyEvent is processed then the return value is true, otherwise
|
||||
// false.
|
||||
|
||||
bool DrawSelection::KeyInput(const KeyEvent& rKEvt)
|
||||
{
|
||||
bool bReturn = false;
|
||||
|
||||
switch (rKEvt.GetKeyCode().GetCode())
|
||||
{
|
||||
case KEY_ESCAPE:
|
||||
{
|
||||
if (m_pWin->IsDrawAction())
|
||||
{
|
||||
m_pSh->BreakMark();
|
||||
m_pWin->ReleaseMouse();
|
||||
}
|
||||
bReturn = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bReturn)
|
||||
bReturn = SwDrawBase::KeyInput(rKEvt);
|
||||
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
void DrawSelection::Activate(const sal_uInt16 nSlotId)
|
||||
{
|
||||
m_pWin->SetSdrDrawMode(OBJ_NONE);
|
||||
|
@ -153,28 +153,6 @@ public:
|
||||
// printer discovery to finish
|
||||
virtual bool checkPrintersChanged( bool bWait );
|
||||
|
||||
// members for administration
|
||||
|
||||
// add a named printer
|
||||
// addPrinter fails if a printer with the same name already exists
|
||||
// or the driver does not exist
|
||||
virtual bool addPrinter( const OUString& rPrinterName, const OUString& rDriverName );
|
||||
|
||||
// remove a named printer
|
||||
// this fails if the config file belonging to this printer
|
||||
// is not writeable
|
||||
// if bCheckOnly is true, the printer is not really removed;
|
||||
// this is for checking if the removal would fail
|
||||
virtual bool removePrinter( const OUString& rPrinterName, bool bCheckOnly );
|
||||
|
||||
// save the changes to all printers. this fails if there
|
||||
// is no writable config file at all
|
||||
virtual bool writePrinterConfig();
|
||||
|
||||
// set a new default printer
|
||||
// fails if the specified printer does not exist
|
||||
virtual bool setDefaultPrinter( const OUString& rPrinterName );
|
||||
|
||||
// abstract print command
|
||||
// returns a stdio FILE* that a postscript file may be written to
|
||||
// this may either be a regular file or the result of popen()
|
||||
|
@ -116,12 +116,6 @@ public:
|
||||
|
||||
// check if the printer configuration has changed
|
||||
virtual bool checkPrintersChanged( bool bWait ) override;
|
||||
|
||||
// members for administration
|
||||
// disable for CPD
|
||||
virtual bool addPrinter( const OUString& rPrinterName, const OUString& rDriverName ) override;
|
||||
virtual bool removePrinter( const OUString& rPrinterName, bool bCheckOnly ) override;
|
||||
virtual bool setDefaultPrinter( const OUString& rPrinterName ) override;
|
||||
};
|
||||
|
||||
} // namespace psp
|
||||
|
@ -82,13 +82,6 @@ public:
|
||||
|
||||
/// check if the printer configuration has changed
|
||||
virtual bool checkPrintersChanged( bool bWait ) override;
|
||||
|
||||
// members for administration
|
||||
// disable for CUPS
|
||||
virtual bool addPrinter( const OUString& rPrinterName, const OUString& rDriverName ) override;
|
||||
virtual bool removePrinter( const OUString& rPrinterName, bool bCheckOnly ) override;
|
||||
virtual bool writePrinterConfig() override;
|
||||
virtual bool setDefaultPrinter( const OUString& rPrinterName ) override;
|
||||
};
|
||||
|
||||
} // namespace psp
|
||||
|
@ -408,13 +408,6 @@ void FormatterBase::SetStrictFormat( bool bStrict )
|
||||
}
|
||||
}
|
||||
|
||||
void FormatterBase::SetLocale( const lang::Locale& rLocale )
|
||||
{
|
||||
ImplGetLocaleDataWrapper().setLanguageTag( LanguageTag( rLocale) );
|
||||
mbDefaultLocale = false;
|
||||
ReformatAll();
|
||||
}
|
||||
|
||||
const lang::Locale& FormatterBase::GetLocale() const
|
||||
{
|
||||
if ( !mpLocaleDataWrapper || mbDefaultLocale )
|
||||
|
@ -1423,12 +1423,6 @@ DateFormatter::~DateFormatter()
|
||||
{
|
||||
}
|
||||
|
||||
void DateFormatter::SetLocale( const css::lang::Locale& rLocale )
|
||||
{
|
||||
mpCalendarWrapper.reset();
|
||||
FormatterBase::SetLocale( rLocale );
|
||||
}
|
||||
|
||||
CalendarWrapper& DateFormatter::GetCalendarWrapper() const
|
||||
{
|
||||
if ( !mpCalendarWrapper )
|
||||
|
@ -754,44 +754,5 @@ bool CPDManager::checkPrintersChanged( bool )
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPDManager::addPrinter( const OUString& rName, const OUString& rDriver )
|
||||
{
|
||||
#if ENABLE_DBUS && ENABLE_GIO
|
||||
// don't touch the CPD printers
|
||||
if (m_aCPDDestMap.find( rName ) != m_aCPDDestMap.end() || rDriver.startsWith("CPD:"))
|
||||
return false;
|
||||
#endif
|
||||
return PrinterInfoManager::addPrinter( rName, rDriver );
|
||||
}
|
||||
|
||||
bool CPDManager::removePrinter( const OUString& rName, bool bCheck )
|
||||
{
|
||||
#if ENABLE_DBUS && ENABLE_GIO
|
||||
// don't touch the CPD printers
|
||||
if( m_aCPDDestMap.find( rName ) != m_aCPDDestMap.end() )
|
||||
return false;
|
||||
#endif
|
||||
return PrinterInfoManager::removePrinter( rName, bCheck );
|
||||
}
|
||||
|
||||
bool CPDManager::setDefaultPrinter( const OUString& rName )
|
||||
{
|
||||
bool bSuccess = false;
|
||||
#if ENABLE_DBUS && ENABLE_GIO
|
||||
std::unordered_map< OUString, CPDPrinter * >::iterator nit =
|
||||
m_aCPDDestMap.find( rName );
|
||||
if( nit != m_aCPDDestMap.end())
|
||||
{
|
||||
m_aDefaultPrinter = rName;
|
||||
bSuccess = true;
|
||||
}
|
||||
else
|
||||
bSuccess = PrinterInfoManager::setDefaultPrinter( rName );
|
||||
#else
|
||||
(void)rName;
|
||||
#endif
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
|
@ -732,99 +732,6 @@ bool CUPSManager::checkPrintersChanged( bool bWait )
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
bool CUPSManager::addPrinter( const OUString& rName, const OUString& rDriver )
|
||||
{
|
||||
// don't touch the CUPS printers
|
||||
if( m_aCUPSDestMap.find( rName ) != m_aCUPSDestMap.end() ||
|
||||
rDriver.startsWith("CUPS:")
|
||||
)
|
||||
return false;
|
||||
return PrinterInfoManager::addPrinter( rName, rDriver );
|
||||
}
|
||||
|
||||
bool CUPSManager::removePrinter( const OUString& rName, bool bCheck )
|
||||
{
|
||||
// don't touch the CUPS printers
|
||||
if( m_aCUPSDestMap.find( rName ) != m_aCUPSDestMap.end() )
|
||||
return false;
|
||||
return PrinterInfoManager::removePrinter( rName, bCheck );
|
||||
}
|
||||
|
||||
bool CUPSManager::setDefaultPrinter( const OUString& rName )
|
||||
{
|
||||
bool bSuccess = false;
|
||||
std::unordered_map< OUString, int >::iterator nit =
|
||||
m_aCUPSDestMap.find( rName );
|
||||
if( nit != m_aCUPSDestMap.end() && m_aCUPSMutex.tryToAcquire() )
|
||||
{
|
||||
cups_dest_t* pDests = static_cast<cups_dest_t*>(m_pDests);
|
||||
for( int i = 0; i < m_nDests; i++ )
|
||||
pDests[i].is_default = 0;
|
||||
pDests[ nit->second ].is_default = 1;
|
||||
cupsSetDests( m_nDests, static_cast<cups_dest_t*>(m_pDests) );
|
||||
m_aDefaultPrinter = rName;
|
||||
m_aCUPSMutex.release();
|
||||
bSuccess = true;
|
||||
}
|
||||
else
|
||||
bSuccess = PrinterInfoManager::setDefaultPrinter( rName );
|
||||
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
bool CUPSManager::writePrinterConfig()
|
||||
{
|
||||
bool bDestModified = false;
|
||||
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
|
||||
|
||||
for( std::unordered_map< OUString, Printer >::iterator prt =
|
||||
m_aPrinters.begin(); prt != m_aPrinters.end(); ++prt )
|
||||
{
|
||||
std::unordered_map< OUString, int >::iterator nit =
|
||||
m_aCUPSDestMap.find( prt->first );
|
||||
if( nit == m_aCUPSDestMap.end() )
|
||||
continue;
|
||||
|
||||
if( ! prt->second.m_bModified )
|
||||
continue;
|
||||
|
||||
if( m_aCUPSMutex.tryToAcquire() )
|
||||
{
|
||||
bDestModified = true;
|
||||
cups_dest_t* pDest = static_cast<cups_dest_t*>(m_pDests) + nit->second;
|
||||
PrinterInfo& rInfo = prt->second.m_aInfo;
|
||||
|
||||
// create new option list
|
||||
int nNewOptions = 0;
|
||||
cups_option_t* pNewOptions = nullptr;
|
||||
int nValues = rInfo.m_aContext.countValuesModified();
|
||||
for( int i = 0; i < nValues; i++ )
|
||||
{
|
||||
const PPDKey* pKey = rInfo.m_aContext.getModifiedKey( i );
|
||||
const PPDValue* pValue = rInfo.m_aContext.getValue( pKey );
|
||||
if( pKey && pValue ) // sanity check
|
||||
{
|
||||
OString aName = OUStringToOString( pKey->getKey(), aEncoding );
|
||||
OString aValue = OUStringToOString( pValue->m_aOption, aEncoding );
|
||||
nNewOptions = cupsAddOption( aName.getStr(), aValue.getStr(), nNewOptions, &pNewOptions );
|
||||
}
|
||||
}
|
||||
// set PPD options on CUPS dest
|
||||
cupsFreeOptions( pDest->num_options, pDest->options );
|
||||
pDest->num_options = nNewOptions;
|
||||
pDest->options = pNewOptions;
|
||||
m_aCUPSMutex.release();
|
||||
}
|
||||
}
|
||||
if( bDestModified && m_aCUPSMutex.tryToAcquire() )
|
||||
{
|
||||
cupsSetDests( m_nDests, static_cast<cups_dest_t*>(m_pDests) );
|
||||
m_aCUPSMutex.release();
|
||||
}
|
||||
|
||||
return PrinterInfoManager::writePrinterConfig();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
class RTSPWDialog : public weld::GenericDialogController
|
||||
|
@ -558,273 +558,6 @@ const PrinterInfo& PrinterInfoManager::getPrinterInfo( const OUString& rPrinter
|
||||
return it != m_aPrinters.end() ? it->second.m_aInfo : aEmptyInfo;
|
||||
}
|
||||
|
||||
// need to check writeability / creatability of config files
|
||||
static bool checkWriteability( const OUString& rUniPath )
|
||||
{
|
||||
bool bRet = false;
|
||||
OUString aSysPath;
|
||||
FileBase::getSystemPathFromFileURL( rUniPath, aSysPath );
|
||||
SvFileStream aStream( aSysPath, StreamMode::READ | StreamMode::WRITE );
|
||||
if( aStream.IsOpen() && aStream.IsWritable() )
|
||||
bRet = true;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
bool PrinterInfoManager::writePrinterConfig()
|
||||
{
|
||||
// find at least one writeable config
|
||||
std::unordered_map< OUString, std::unique_ptr<Config> > files;
|
||||
std::unordered_map< OUString, int > rofiles;
|
||||
std::unordered_map< OUString, std::unique_ptr<Config> >::iterator file_it;
|
||||
|
||||
for (auto const& watchFile : m_aWatchFiles)
|
||||
{
|
||||
if( checkWriteability( watchFile.m_aFilePath ) )
|
||||
{
|
||||
files[ watchFile.m_aFilePath ].reset(new Config( watchFile.m_aFilePath ));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( files.empty() )
|
||||
return false;
|
||||
|
||||
Config* pGlobal = files.begin()->second.get();
|
||||
pGlobal->SetGroup( GLOBAL_DEFAULTS_GROUP );
|
||||
|
||||
for (auto & printer : m_aPrinters)
|
||||
{
|
||||
if( ! printer.second.m_bModified )
|
||||
// printer was not changed, do nothing
|
||||
continue;
|
||||
|
||||
// don't save autoqueue printers
|
||||
sal_Int32 nIndex = 0;
|
||||
bool bAutoQueue = false;
|
||||
while( nIndex != -1 && ! bAutoQueue )
|
||||
{
|
||||
OUString aToken( printer.second.m_aInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
|
||||
if( aToken == "autoqueue" )
|
||||
bAutoQueue = true;
|
||||
}
|
||||
if( bAutoQueue )
|
||||
continue;
|
||||
|
||||
if( !printer.second.m_aFile.isEmpty() )
|
||||
{
|
||||
// check if file is writable
|
||||
if( files.find( printer.second.m_aFile ) == files.end() )
|
||||
{
|
||||
bool bInsertToNewFile = false;
|
||||
// maybe it is simply not inserted yet
|
||||
if( rofiles.find( printer.second.m_aFile ) == rofiles.end() )
|
||||
{
|
||||
if( checkWriteability( printer.second.m_aFile ) )
|
||||
files[ printer.second.m_aFile ].reset( new Config( printer.second.m_aFile ) );
|
||||
else
|
||||
bInsertToNewFile = true;
|
||||
}
|
||||
else
|
||||
bInsertToNewFile = true;
|
||||
// original file is read only, insert printer in a new writeable file
|
||||
if( bInsertToNewFile )
|
||||
{
|
||||
rofiles[ printer.second.m_aFile ] = 1;
|
||||
// update alternate file list
|
||||
// be sure m_aAlternateFiles doesn't contain the m_aFile value
|
||||
printer.second.m_aAlternateFiles.erase( files.begin()->first );
|
||||
printer.second.m_aAlternateFiles.insert( printer.second.m_aFile );
|
||||
// update file
|
||||
printer.second.m_aFile = files.begin()->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // a new printer, write it to the first file available
|
||||
printer.second.m_aFile = files.begin()->first;
|
||||
|
||||
if( printer.second.m_aGroup.isEmpty() ) // probably a new printer
|
||||
printer.second.m_aGroup = OString( printer.first.getStr(), printer.first.getLength(), RTL_TEXTENCODING_UTF8 );
|
||||
|
||||
if( files.find( printer.second.m_aFile ) != files.end() )
|
||||
{
|
||||
Config* pConfig = files[ printer.second.m_aFile ].get();
|
||||
pConfig->DeleteGroup( printer.second.m_aGroup ); // else some old keys may remain
|
||||
pConfig->SetGroup( printer.second.m_aGroup );
|
||||
|
||||
OStringBuffer aValue(OUStringToOString(printer.second.m_aInfo.m_aDriverName, RTL_TEXTENCODING_UTF8));
|
||||
aValue.append('/');
|
||||
aValue.append(OUStringToOString(printer.first, RTL_TEXTENCODING_UTF8));
|
||||
pConfig->WriteKey("Printer", aValue.makeStringAndClear());
|
||||
pConfig->WriteKey( "DefaultPrinter", printer.first == m_aDefaultPrinter ? "1" : "0" );
|
||||
pConfig->WriteKey( "Location", OUStringToOString(printer.second.m_aInfo.m_aLocation, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Comment", OUStringToOString(printer.second.m_aInfo.m_aComment, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Command", OUStringToOString(printer.second.m_aInfo.m_aCommand, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "QuickCommand", OUStringToOString(printer.second.m_aInfo.m_aQuickCommand, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Features", OUStringToOString(printer.second.m_aInfo.m_aFeatures, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey("Copies", OString::number(printer.second.m_aInfo.m_nCopies));
|
||||
pConfig->WriteKey( "Orientation", printer.second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
|
||||
pConfig->WriteKey("PSLevel", OString::number(printer.second.m_aInfo.m_nPSLevel));
|
||||
pConfig->WriteKey("PDFDevice", OString::number(printer.second.m_aInfo.m_nPDFDevice));
|
||||
pConfig->WriteKey("ColorDevice", OString::number(printer.second.m_aInfo.m_nColorDevice));
|
||||
pConfig->WriteKey("ColorDepth", OString::number(printer.second.m_aInfo.m_nColorDepth));
|
||||
aValue.append(static_cast<sal_Int32>(printer.second.m_aInfo.m_nLeftMarginAdjust));
|
||||
aValue.append(',');
|
||||
aValue.append(static_cast<sal_Int32>(printer.second.m_aInfo.m_nRightMarginAdjust));
|
||||
aValue.append(',');
|
||||
aValue.append(static_cast<sal_Int32>(printer.second.m_aInfo.m_nTopMarginAdjust));
|
||||
aValue.append(',');
|
||||
aValue.append(static_cast<sal_Int32>(printer.second.m_aInfo.m_nBottomMarginAdjust));
|
||||
pConfig->WriteKey("MarginAdjust", aValue.makeStringAndClear());
|
||||
|
||||
if( ! printer.second.m_aInfo.m_aDriverName.startsWith( "CUPS:" ) )
|
||||
{
|
||||
// write PPDContext (not for CUPS)
|
||||
for( int i = 0; i < printer.second.m_aInfo.m_aContext.countValuesModified(); i++ )
|
||||
{
|
||||
const PPDKey* pKey = printer.second.m_aInfo.m_aContext.getModifiedKey( i );
|
||||
OStringBuffer aKey("PPD_");
|
||||
aKey.append(OUStringToOString(pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1));
|
||||
|
||||
const PPDValue* pValue = printer.second.m_aInfo.m_aContext.getValue( pKey );
|
||||
if (pValue)
|
||||
aValue.append(OUStringToOString(pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1));
|
||||
else
|
||||
aValue.append("*nil");
|
||||
pConfig->WriteKey(aKey.makeStringAndClear(), aValue.makeStringAndClear());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get rid of Config objects. this also writes any changes
|
||||
files.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrinterInfoManager::addPrinter( const OUString& rPrinterName, const OUString& rDriverName )
|
||||
{
|
||||
bool bSuccess = false;
|
||||
|
||||
const PPDParser* pParser = nullptr;
|
||||
if( m_aPrinters.find( rPrinterName ) == m_aPrinters.end() && ( pParser = PPDParser::getParser( rDriverName ) ) )
|
||||
{
|
||||
Printer aPrinter;
|
||||
aPrinter.m_bModified = true;
|
||||
aPrinter.m_aInfo = m_aGlobalDefaults;
|
||||
aPrinter.m_aInfo.m_aDriverName = rDriverName;
|
||||
aPrinter.m_aInfo.m_pParser = pParser;
|
||||
aPrinter.m_aInfo.m_aContext.setParser( pParser );
|
||||
aPrinter.m_aInfo.m_aPrinterName = rPrinterName;
|
||||
|
||||
// merge PPD values with global defaults
|
||||
for( int nPPDValueModified = 0; nPPDValueModified < m_aGlobalDefaults.m_aContext.countValuesModified(); nPPDValueModified++ )
|
||||
{
|
||||
const PPDKey* pDefKey = m_aGlobalDefaults.m_aContext.getModifiedKey( nPPDValueModified );
|
||||
const PPDValue* pDefValue = m_aGlobalDefaults.m_aContext.getValue( pDefKey );
|
||||
const PPDKey* pPrinterKey = pDefKey ? aPrinter.m_aInfo.m_pParser->getKey( pDefKey->getKey() ) : nullptr;
|
||||
if( pDefKey && pPrinterKey )
|
||||
// at least the options exist in both PPDs
|
||||
{
|
||||
if( pDefValue )
|
||||
{
|
||||
const PPDValue* pPrinterValue = pPrinterKey->getValue( pDefValue->m_aOption );
|
||||
if( pPrinterValue )
|
||||
// the printer has a corresponding option for the key
|
||||
aPrinter.m_aInfo.m_aContext.setValue( pPrinterKey, pPrinterValue );
|
||||
}
|
||||
else
|
||||
aPrinter.m_aInfo.m_aContext.setValue( pPrinterKey, nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
m_aPrinters[ rPrinterName ] = aPrinter;
|
||||
bSuccess = true;
|
||||
#if OSL_DEBUG_LEVEL > 1
|
||||
fprintf( stderr, "new printer %s, level = %d, pdfdevice = %d, colordevice = %d, depth = %d\n",
|
||||
OUStringToOString( rPrinterName, osl_getThreadTextEncoding() ).getStr(),
|
||||
m_aPrinters[rPrinterName].m_aInfo.m_nPSLevel,
|
||||
m_aPrinters[rPrinterName].m_aInfo.m_nPDFDevice,
|
||||
m_aPrinters[rPrinterName].m_aInfo.m_nColorDevice,
|
||||
m_aPrinters[rPrinterName].m_aInfo.m_nColorDepth );
|
||||
#endif
|
||||
// comment: logically one should writePrinterConfig() here
|
||||
// but immediately after addPrinter() a changePrinterInfo()
|
||||
// will follow which writes it again, so we can currently save some
|
||||
// performance here
|
||||
}
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
bool PrinterInfoManager::removePrinter( const OUString& rPrinterName, bool bCheckOnly )
|
||||
{
|
||||
bool bSuccess = true;
|
||||
|
||||
std::unordered_map< OUString, Printer >::iterator it = m_aPrinters.find( rPrinterName );
|
||||
if( it != m_aPrinters.end() )
|
||||
{
|
||||
if( !it->second.m_aFile.isEmpty() )
|
||||
{
|
||||
// this printer already exists in a config file
|
||||
|
||||
// check writeability of config file(s)
|
||||
if( ! checkWriteability( it->second.m_aFile ) )
|
||||
bSuccess = false;
|
||||
else
|
||||
{
|
||||
for (auto const& file : it->second.m_aAlternateFiles)
|
||||
{
|
||||
if( ! checkWriteability(file) )
|
||||
{
|
||||
bSuccess = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( bSuccess && ! bCheckOnly )
|
||||
{
|
||||
|
||||
Config aConfig( it->second.m_aFile );
|
||||
aConfig.DeleteGroup( it->second.m_aGroup );
|
||||
aConfig.Flush();
|
||||
for (auto const& file : it->second.m_aAlternateFiles)
|
||||
{
|
||||
Config aAltConfig( file );
|
||||
aAltConfig.DeleteGroup( it->second.m_aGroup );
|
||||
aAltConfig.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
if( bSuccess && ! bCheckOnly )
|
||||
{
|
||||
m_aPrinters.erase( it );
|
||||
// need this here because someone may call
|
||||
// checkPrintersChanged after the removal
|
||||
// but then other added printers were not flushed
|
||||
// to disk, so they are discarded
|
||||
writePrinterConfig();
|
||||
}
|
||||
}
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
bool PrinterInfoManager::setDefaultPrinter( const OUString& rPrinterName )
|
||||
{
|
||||
bool bSuccess = false;
|
||||
|
||||
std::unordered_map< OUString, Printer >::iterator it = m_aPrinters.find( rPrinterName );
|
||||
if( it != m_aPrinters.end() )
|
||||
{
|
||||
bSuccess = true;
|
||||
it->second.m_bModified = true;
|
||||
if( ( it = m_aPrinters.find( m_aDefaultPrinter ) ) != m_aPrinters.end() )
|
||||
it->second.m_bModified = true;
|
||||
m_aDefaultPrinter = rPrinterName;
|
||||
writePrinterConfig();
|
||||
}
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
bool PrinterInfoManager::checkFeatureToken( const OUString& rPrinterName, const char* pToken ) const
|
||||
{
|
||||
const PrinterInfo& rPrinterInfo( getPrinterInfo( rPrinterName ) );
|
||||
|
@ -111,14 +111,6 @@ public:
|
||||
TableManager::cellProps( pProps );
|
||||
};
|
||||
|
||||
virtual void cellPropsByCell(unsigned int i, const TablePropertyMapPtr& pProps) override
|
||||
{
|
||||
if ( m_pStyleProps.get( ) )
|
||||
m_pStyleProps->InsertProps(pProps.get());
|
||||
else
|
||||
TableManager::cellPropsByCell( i, pProps );
|
||||
};
|
||||
|
||||
virtual void insertRowProps(const TablePropertyMapPtr& pProps) override
|
||||
{
|
||||
if ( m_pStyleProps.get( ) )
|
||||
|
@ -94,19 +94,6 @@ void TableManager::insertRowProps(const TablePropertyMapPtr& pProps)
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableManager::cellPropsByCell(unsigned int i, const TablePropertyMapPtr& pProps)
|
||||
{
|
||||
#ifdef DEBUG_WRITERFILTER
|
||||
TagLogger::getInstance().startElement("tablemanager.cellPropsByCell");
|
||||
#endif
|
||||
|
||||
mTableDataStack.top()->insertCellProperties(i, pProps);
|
||||
|
||||
#ifdef DEBUG_WRITERFILTER
|
||||
TagLogger::getInstance().endElement();
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableManager::cellProps(const TablePropertyMapPtr& pProps)
|
||||
{
|
||||
#ifdef DEBUG_WRITERFILTER
|
||||
|
@ -443,14 +443,6 @@ public:
|
||||
*/
|
||||
virtual void cellProps(const TablePropertyMapPtr& pProps);
|
||||
|
||||
/**
|
||||
Handle properties of a certain cell in the current row.
|
||||
|
||||
@paran i index of the cell in the current row
|
||||
@param pProps the properties
|
||||
*/
|
||||
virtual void cellPropsByCell(unsigned int i, const TablePropertyMapPtr& pProps);
|
||||
|
||||
/**
|
||||
Handle properties of the current row.
|
||||
|
||||
|
@ -295,12 +295,6 @@ Token_t OOXMLFastContextHandler::getToken() const
|
||||
return mnToken;
|
||||
}
|
||||
|
||||
void OOXMLFastContextHandler::setParent
|
||||
(OOXMLFastContextHandler * pParent)
|
||||
{
|
||||
mpParent = pParent;
|
||||
}
|
||||
|
||||
void OOXMLFastContextHandler::sendTableDepth() const
|
||||
{
|
||||
if (mnTableDepth > 0)
|
||||
@ -1113,15 +1107,6 @@ void OOXMLFastContextHandlerProperties::handleHyperlinkURL() {
|
||||
getPropertySet()->resolve(aHyperlinkURLHandler);
|
||||
}
|
||||
|
||||
void OOXMLFastContextHandlerProperties::setParent
|
||||
(OOXMLFastContextHandler * pParent)
|
||||
{
|
||||
OOXMLFastContextHandler::setParent(pParent);
|
||||
|
||||
if (mpParent->getResource() == STREAM)
|
||||
mbResolve = true;
|
||||
}
|
||||
|
||||
void OOXMLFastContextHandlerProperties::setPropertySet
|
||||
(const OOXMLPropertySet::Pointer_t& pPropertySet)
|
||||
{
|
||||
|
@ -119,7 +119,6 @@ public:
|
||||
sal_Int32 getXNoteId() const;
|
||||
void setForwardEvents(bool bForwardEvents);
|
||||
bool isForwardEvents() const;
|
||||
virtual void setParent(OOXMLFastContextHandler * pParent);
|
||||
virtual void setId(Id nId);
|
||||
virtual Id getId() const;
|
||||
|
||||
@ -298,7 +297,6 @@ protected:
|
||||
OOXMLPropertySet::Pointer_t mpPropertySet;
|
||||
|
||||
virtual void lcl_endFastElement(Token_t Element) override;
|
||||
virtual void setParent(OOXMLFastContextHandler * pParent) override;
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user