viewfun3.cxx (a206ee71) viewfun3.cxx (52f1c2ee)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 806 unchanged lines hidden (view full) ---

815 }
816 return bRet;
817}
818
819
820//----------------------------------------------------------------------------
821// P A S T E
822
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 806 unchanged lines hidden (view full) ---

815 }
816 return bRet;
817}
818
819
820//----------------------------------------------------------------------------
821// P A S T E
822
823sal_Bool ScViewFunc::PasteOnDrawObject( const uno::Reference<datatransfer::XTransferable>& rxTransferable,
824 SdrObject* pHitObj, sal_Bool bLink )
823sal_Bool ScViewFunc::PasteOnDrawObjectLinked(
824 const uno::Reference<datatransfer::XTransferable>& rxTransferable,
825 SdrObject& rHitObj)
825{
826{
826 sal_Bool bRet = sal_False;
827 if ( bLink )
828 {
829 TransferableDataHelper aDataHelper( rxTransferable );
830 if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) )
831 {
832 SotStorageStreamRef xStm;
833 if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ) )
834 {
835 Graphic aGraphic;
836 *xStm >> aGraphic;
837 bRet = ApplyGraphicToObject( pHitObj, aGraphic );
838 }
839 }
840 else if ( aDataHelper.HasFormat( SOT_FORMAT_GDIMETAFILE ) )
841 {
842 GDIMetaFile aMtf;
843 if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) )
844 bRet = ApplyGraphicToObject( pHitObj, Graphic(aMtf) );
845 }
846 else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) || aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) )
847 {
848 BitmapEx aBmpEx;
849 if( aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) )
850 bRet = ApplyGraphicToObject( pHitObj, Graphic(aBmpEx) );
851 }
852 }
853 else
854 {
855 // ham' wa noch nich
856 }
857 return bRet;
827 TransferableDataHelper aDataHelper( rxTransferable );
828
829 if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) )
830 {
831 SotStorageStreamRef xStm;
832 ScDrawView* pScDrawView = GetScDrawView();
833
834 if( pScDrawView && aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ) )
835 {
836 Graphic aGraphic;
837
838 *xStm >> aGraphic;
839
840 const String aEmpty;
841 const String aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP));
842
843 if(pScDrawView->ApplyGraphicToObject( rHitObj, aGraphic, aBeginUndo, aEmpty, aEmpty ))
844 {
845 return sal_True;
846 }
847 }
848 }
849 else if ( aDataHelper.HasFormat( SOT_FORMAT_GDIMETAFILE ) )
850 {
851 GDIMetaFile aMtf;
852 ScDrawView* pScDrawView = GetScDrawView();
853
854 if( pScDrawView && aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) )
855 {
856 const String aEmpty;
857 const String aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP));
858
859 if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aMtf), aBeginUndo, aEmpty, aEmpty ))
860 {
861 return sal_True;
862 }
863 }
864 }
865 else if ( aDataHelper.HasFormat( SOT_FORMAT_BITMAP ) || aDataHelper.HasFormat( SOT_FORMATSTR_ID_PNG ) )
866 {
867 BitmapEx aBmpEx;
868 ScDrawView* pScDrawView = GetScDrawView();
869
870 if( pScDrawView && aDataHelper.GetBitmapEx( FORMAT_BITMAP, aBmpEx ) )
871 {
872 const String aEmpty;
873 const String aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP));
874
875 if(pScDrawView->ApplyGraphicToObject( rHitObj, Graphic(aBmpEx), aBeginUndo, aEmpty, aEmpty ))
876 {
877 return sal_True;
878 }
879 }
880 }
881
882 return sal_False;
858}
859
860sal_Bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
861 const ScMarkData& rTabSelection, sal_uInt16 nMask )
862{
863 SCTAB nTabCount = pDoc->GetTableCount();
864 for (SCTAB nTab=0; nTab<nTabCount; nTab++)
865 if ( rTabSelection.GetTableSelect(nTab) && pDoc->HasAttrib( nCol1, nRow1, nTab, nCol2, nRow2, nTab, nMask ) )

--- 981 unchanged lines hidden ---
883}
884
885sal_Bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
886 const ScMarkData& rTabSelection, sal_uInt16 nMask )
887{
888 SCTAB nTabCount = pDoc->GetTableCount();
889 for (SCTAB nTab=0; nTab<nTabCount; nTab++)
890 if ( rTabSelection.GetTableSelect(nTab) && pDoc->HasAttrib( nCol1, nRow1, nTab, nCol2, nRow2, nTab, nMask ) )

--- 981 unchanged lines hidden ---