unoshape.cxx (bb18ee55) unoshape.cxx (70d3707a)
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

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

1575 long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
1576 if( nPos == -1 )
1577 return sal_False;
1578
1579 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
1580 XFillBitmapItem aBmpItem;
1581 aBmpItem.SetWhich( XATTR_FILLBITMAP );
1582 aBmpItem.SetName( rName );
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

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

1575 long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
1576 if( nPos == -1 )
1577 return sal_False;
1578
1579 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
1580 XFillBitmapItem aBmpItem;
1581 aBmpItem.SetWhich( XATTR_FILLBITMAP );
1582 aBmpItem.SetName( rName );
1583 aBmpItem.SetBitmapValue( pEntry->GetXBitmap() );
1583 aBmpItem.SetGraphicObject(pEntry->GetGraphicObject());
1584 rSet.Put( aBmpItem );
1585 break;
1586 }
1587 case XATTR_FILLGRADIENT:
1588 {
1589 XGradientList* pGradientList = pModel->GetGradientList();
1590
1591 if( !pGradientList )

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

1732 }
1733 }
1734
1735 return sal_False;
1736}
1737
1738//----------------------------------------------------------------------
1739
1584 rSet.Put( aBmpItem );
1585 break;
1586 }
1587 case XATTR_FILLGRADIENT:
1588 {
1589 XGradientList* pGradientList = pModel->GetGradientList();
1590
1591 if( !pGradientList )

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

1732 }
1733 }
1734
1735 return sal_False;
1736}
1737
1738//----------------------------------------------------------------------
1739
1740// static
1741/* os: unused function
1742 uno::Any SAL_CALL SvxShape::GetFillAttributeByName(
1743 const ::rtl::OUString& rPropertyName, const ::rtl::OUString& rName, SdrModel* pModel )
1744{
1745 uno::Any aResult;
1746 DBG_ASSERT( pModel, "Invalid Model in GetFillAttributeByName()" );
1747 if( ! pModel )
1748 return aResult;
1749
1750 sal_Int16 nWhich = SvxUnoGetWhichIdForNamedProperty( rPropertyName );
1751
1752 // search pool for item
1753 const SfxItemPool& rPool = pModel->GetItemPool();
1754
1755 const String aSearchName( rName );
1756 const sal_uInt32 nCount = rPool.GetItemCount((sal_uInt16)nWhich);
1757 const NameOrIndex* pItem = 0;
1758 bool bFound = false;
1759
1760 for( sal_uInt32 nSurrogate = 0; ! bFound && nSurrogate < nCount; nSurrogate++ )
1761 {
1762 pItem = (NameOrIndex*)rPool.GetItem((sal_uInt16)nWhich, nSurrogate);
1763 if( pItem && ( pItem->GetName() == aSearchName ) )
1764 {
1765 bFound = true;
1766 }
1767 }
1768
1769 // check the property lists that are loaded for the model for items that
1770 // support such.
1771 String aStrName;
1772 SvxUnogetInternalNameForItem( nWhich, rName, aStrName );
1773
1774 switch( nWhich )
1775 {
1776 case XATTR_FILLBITMAP:
1777 {
1778 XFillBitmapItem aBmpItem;
1779 if( ! bFound )
1780 {
1781 XBitmapList* pBitmapList = pModel->GetBitmapList();
1782
1783 if( !pBitmapList )
1784 break;
1785
1786 long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
1787 if( nPos == -1 )
1788 break;
1789
1790 XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
1791 aBmpItem.SetWhich( XATTR_FILLBITMAP );
1792 aBmpItem.SetName( rName );
1793 aBmpItem.SetBitmapValue( pEntry->GetXBitmap() );
1794 pItem = & aBmpItem;
1795 }
1796 DBG_ASSERT( pItem, "Invalid Item" );
1797 if( pItem )
1798 pItem->QueryValue( aResult ); // default: XBitmap. MID_GRAFURL instead?
1799 }
1800 break;
1801
1802 case XATTR_FILLGRADIENT:
1803 {
1804 XFillGradientItem aGrdItem;
1805 if( ! bFound )
1806 {
1807 XGradientList* pGradientList = pModel->GetGradientList();
1808
1809 if( !pGradientList )
1810 break;
1811
1812 long nPos = ((XPropertyList*)pGradientList)->Get(aStrName);
1813 if( nPos == -1 )
1814 break;
1815
1816 XGradientEntry* pEntry = pGradientList->GetGradient( nPos );
1817 aGrdItem.SetWhich( XATTR_FILLGRADIENT );
1818 aGrdItem.SetName( rName );
1819 aGrdItem.SetGradientValue( pEntry->GetGradient() );
1820 pItem = & aGrdItem;
1821 }
1822 DBG_ASSERT( pItem, "Invalid Item" );
1823 if( pItem )
1824 pItem->QueryValue( aResult, MID_FILLGRADIENT );
1825 }
1826 break;
1827
1828 case XATTR_FILLHATCH:
1829 {
1830 XFillHatchItem aHatchItem;
1831 if( ! bFound )
1832 {
1833 XHatchList* pHatchList = pModel->GetHatchList();
1834
1835 if( !pHatchList )
1836 break;
1837
1838 long nPos = ((XPropertyList*)pHatchList)->Get(aStrName);
1839 if( nPos == -1 )
1840 break;
1841
1842 XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
1843 aHatchItem.SetWhich( XATTR_FILLHATCH );
1844 aHatchItem.SetName( rName );
1845 aHatchItem.SetHatchValue( pEntry->GetHatch() );
1846 pItem = & aHatchItem;
1847 }
1848 DBG_ASSERT( pItem, "Invalid Item" );
1849 if( pItem )
1850 pItem->QueryValue( aResult, MID_FILLHATCH );
1851 }
1852 break;
1853
1854 case XATTR_LINEEND:
1855 case XATTR_LINESTART:
1856 {
1857 if( ! bFound )
1858 {
1859 XLineEndList* pLineEndList = pModel->GetLineEndList();
1860
1861 if( !pLineEndList )
1862 break;
1863
1864 long nPos = ((XPropertyList*)pLineEndList)->Get(aStrName);
1865 if( nPos == -1 )
1866 break;
1867
1868 XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
1869 if( nWhich == XATTR_LINEEND )
1870 {
1871 XLineEndItem aLEItem;
1872 aLEItem.SetWhich( XATTR_LINEEND );
1873 aLEItem.SetName( rName );
1874 aLEItem.SetLineEndValue( pEntry->GetLineEnd() );
1875 aLEItem.QueryValue( aResult );
1876 }
1877 else
1878 {
1879 XLineStartItem aLSItem;
1880 aLSItem.SetWhich( XATTR_LINESTART );
1881 aLSItem.SetName( rName );
1882 aLSItem.SetLineStartValue( pEntry->GetLineEnd() );
1883 aLSItem.QueryValue( aResult );
1884 }
1885 }
1886 else
1887 {
1888 DBG_ASSERT( pItem, "Invalid Item" );
1889 if( pItem )
1890 pItem->QueryValue( aResult );
1891 }
1892 }
1893 break;
1894
1895 case XATTR_LINEDASH:
1896 {
1897 XLineDashItem aDashItem;
1898 if( ! bFound )
1899 {
1900 XDashList* pDashList = pModel->GetDashList();
1901
1902 if( !pDashList )
1903 break;
1904
1905 long nPos = ((XPropertyList*)pDashList)->Get(aStrName);
1906 if( nPos == -1 )
1907 break;
1908
1909 XDashEntry* pEntry = pDashList->GetDash( nPos );
1910 aDashItem.SetWhich( XATTR_LINEDASH );
1911 aDashItem.SetName( rName );
1912 aDashItem.SetDashValue( pEntry->GetDash() );
1913 pItem = & aDashItem;
1914 }
1915 DBG_ASSERT( pItem, "Invalid Item" );
1916 if( pItem )
1917 pItem->QueryValue( aResult, MID_LINEDASH );
1918 }
1919 break;
1920 }
1921
1922 return aResult;
1923} */
1924
1925//----------------------------------------------------------------------
1926
1927void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1928 throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1929{
1930 if( mpImpl->mpMaster )
1931 {
1932 mpImpl->mpMaster->setPropertyValue( rPropertyName, rVal );
1933 }
1934 else

--- 2736 unchanged lines hidden ---
1740void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
1741 throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1742{
1743 if( mpImpl->mpMaster )
1744 {
1745 mpImpl->mpMaster->setPropertyValue( rPropertyName, rVal );
1746 }
1747 else

--- 2736 unchanged lines hidden ---